summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-07-16 06:39:50 +0000
committerMarcus Boerger <helly@php.net>2004-07-16 06:39:50 +0000
commit381a3b234f6b5a276d61c8141ced8ae8002d6734 (patch)
tree92189d3e29bfc9832a90365cbd497d9b8a6e376f
parent6dd2613d7ba7d2a8e34a99e6bfeda44ddb540323 (diff)
downloadphp-git-381a3b234f6b5a276d61c8141ced8ae8002d6734.tar.gz
Bugfix #28464 catch() does not catch exceptions by interfaces
-rw-r--r--Zend/zend_execute.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 026b635a95..a958a1be60 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2929,21 +2929,16 @@ int zend_catch_handler(ZEND_OPCODE_HANDLER_ARGS)
}
ce = Z_OBJCE_P(EG(exception));
if (ce != EX_T(opline->op1.u.var).class_entry) {
- while (ce->parent) {
- if (ce->parent == EX_T(opline->op1.u.var).class_entry) {
- goto exception_should_be_taken;
+ if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) {
+ if (opline->op1.u.EA.type) {
+ zend_throw_exception_internal(NULL TSRMLS_CC);
+ NEXT_OPCODE();
}
- ce = ce->parent;
- }
- if (opline->op1.u.EA.type) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
- NEXT_OPCODE();
+ SET_OPCODE(&op_array->opcodes[opline->extended_value]);
+ return 0; /* CHECK_ME */
}
- SET_OPCODE(&op_array->opcodes[opline->extended_value]);
- return 0; /* CHECK_ME */
}
-exception_should_be_taken:
zend_hash_update(EG(active_symbol_table), opline->op2.u.constant.value.str.val,
opline->op2.u.constant.value.str.len+1, &EG(exception), sizeof(zval *), (void **) NULL);
EG(exception) = NULL;