diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-10-08 16:53:23 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-10-08 17:17:49 +0200 |
commit | 21148679d1dfb614404c09a918d9d2b74f120640 (patch) | |
tree | ae845ee337a9b982fe0e5c1632a42ab0560ee83a /Zend/zend_API.c | |
parent | 68b26ff8cf2390ba5b7565b6624485f2ee6afbf6 (diff) | |
download | php-git-21148679d1dfb614404c09a918d9d2b74f120640.tar.gz |
Handle "non well formed" exception during ZPP
Previously if the "non well formed" notice was converted into an
exception we'd still end up executing the function.
Also drop the now unnecessary EG(exception) checks in the engine.
Additionally remote a bogus exception in zend_is_callable: It
should only be writing to error, but not directly throwing.
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 5be9d94dee..3fef3733f7 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -438,6 +438,9 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest) return 0; } } + if (UNEXPECTED(EG(exception))) { + return 0; + } } else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) { *dest = 0; } else if (EXPECTED(Z_TYPE_P(arg) == IS_TRUE)) { @@ -479,6 +482,9 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_long_cap_weak(zval *arg, zend_long *de return 0; } } + if (UNEXPECTED(EG(exception))) { + return 0; + } } else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) { *dest = 0; } else if (EXPECTED(Z_TYPE_P(arg) == IS_TRUE)) { @@ -514,6 +520,9 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest) / return 0; } } + if (UNEXPECTED(EG(exception))) { + return 0; + } } else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) { *dest = 0.0; } else if (EXPECTED(Z_TYPE_P(arg) == IS_TRUE)) { @@ -3163,12 +3172,9 @@ get_function_via_handler: if (retval) { if (fcc->calling_scope && !call_via_handler) { if (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT) { + retval = 0; if (error) { zend_spprintf(error, 0, "cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name)); - retval = 0; - } else { - zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name)); - retval = 0; } } else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) { int severity; |