From 81c824f41f5e4d0b3720439836302ad1832cdcc7 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 26 May 2020 11:33:50 +0200 Subject: [PATCH] Clarify ZEND_CATCH code UNDEF the opcode result instead of addref'ing the exception. --- Zend/zend_vm_def.h | 2 +- Zend/zend_vm_execute.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 9cccd2e2f9..ed160f18da 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4493,7 +4493,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, JMP_ADDR, LAST_CATCH|CACHE_SLOT) zval_ptr_dtor(ex); ZVAL_OBJ(ex, EG(exception)); if (UNEXPECTED(EG(exception) != exception)) { - GC_ADDREF(EG(exception)); + ZVAL_UNDEF(ex); HANDLE_EXCEPTION(); } else { EG(exception) = NULL; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 068e1338a3..d4077f5605 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -3709,7 +3709,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_HANDLER(ZEND_ zval_ptr_dtor(ex); ZVAL_OBJ(ex, EG(exception)); if (UNEXPECTED(EG(exception) != exception)) { - GC_ADDREF(EG(exception)); + ZVAL_UNDEF(ex); HANDLE_EXCEPTION(); } else { EG(exception) = NULL; -- 2.40.0