ixed bug that exception won't be catched

Related failed test Zend/tests/bug35437.phpt (after he latest
execute_data improvement, run with non CALL vm kind)
This commit is contained in:
Xinchen Hui 2012-12-18 15:34:47 +08:00
parent d3ec9ceb25
commit 210d428f99
2 changed files with 12 additions and 4 deletions

View file

@ -1942,14 +1942,15 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) {
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) {
zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name, fbc->common.function_name); zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name, fbc->common.function_name);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE(); /* Never reached */
} }
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) {
zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated", zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
fbc->common.scope ? fbc->common.scope->name : "", fbc->common.scope ? fbc->common.scope->name : "",
fbc->common.scope ? "::" : "", fbc->common.scope ? "::" : "",
fbc->common.function_name); fbc->common.function_name);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
} }
} }
if (fbc->common.scope && if (fbc->common.scope &&
@ -1959,6 +1960,9 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* FIXME: output identifiers properly */ /* FIXME: output identifiers properly */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name, fbc->common.function_name); zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name, fbc->common.function_name);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
} else { } else {
/* FIXME: output identifiers properly */ /* FIXME: output identifiers properly */
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */

View file

@ -482,14 +482,15 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) {
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) {
zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name, fbc->common.function_name); zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name, fbc->common.function_name);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE(); /* Never reached */
} }
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) {
zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated", zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
fbc->common.scope ? fbc->common.scope->name : "", fbc->common.scope ? fbc->common.scope->name : "",
fbc->common.scope ? "::" : "", fbc->common.scope ? "::" : "",
fbc->common.function_name); fbc->common.function_name);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
} }
} }
if (fbc->common.scope && if (fbc->common.scope &&
@ -499,6 +500,9 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* FIXME: output identifiers properly */ /* FIXME: output identifiers properly */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name, fbc->common.function_name); zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name, fbc->common.function_name);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
} else { } else {
/* FIXME: output identifiers properly */ /* FIXME: output identifiers properly */
/* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */