Created
January 28, 2020 08:31
-
-
Save dstogov/1195bede1f22d169acb6a9d03d22fbfa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c | |
index f43ba2adc8..2a8e213280 100644 | |
--- a/ext/ffi/ffi.c | |
+++ b/ext/ffi/ffi.c | |
@@ -877,6 +877,11 @@ static void zend_ffi_callback_trampoline(ffi_cif* cif, void* ret, void** args, v | |
} | |
free_alloca(fci.params, use_heap); | |
+ if (EG(exception)) { | |
+ zend_error(E_WARNING, "Uncaught %s in PHP FFI callback", ZSTR_VAL(EG(exception)->ce->name)); | |
+ zend_exception_error(EG(exception), E_ERROR); | |
+ } | |
+ | |
ret_type = ZEND_FFI_TYPE(callback_data->type->func.ret_type); | |
if (ret_type->kind != ZEND_FFI_TYPE_VOID) { | |
zend_ffi_zval_to_cdata(ret, ret_type, &retval); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment