Skip to content

Commit 81c824f

Browse files
committed
Clarify ZEND_CATCH code
UNDEF the opcode result instead of addref'ing the exception.
1 parent f825c0b commit 81c824f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4493,7 +4493,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, JMP_ADDR, LAST_CATCH|CACHE_SLOT)
44934493
zval_ptr_dtor(ex);
44944494
ZVAL_OBJ(ex, EG(exception));
44954495
if (UNEXPECTED(EG(exception) != exception)) {
4496-
GC_ADDREF(EG(exception));
4496+
ZVAL_UNDEF(ex);
44974497
HANDLE_EXCEPTION();
44984498
} else {
44994499
EG(exception) = NULL;

Zend/zend_vm_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3709,7 +3709,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_HANDLER(ZEND_
37093709
zval_ptr_dtor(ex);
37103710
ZVAL_OBJ(ex, EG(exception));
37113711
if (UNEXPECTED(EG(exception) != exception)) {
3712-
GC_ADDREF(EG(exception));
3712+
ZVAL_UNDEF(ex);
37133713
HANDLE_EXCEPTION();
37143714
} else {
37153715
EG(exception) = NULL;

0 commit comments

Comments
 (0)