@@ -100,7 +100,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
100100
101101 if (destructor ) {
102102 zend_object * old_exception ;
103- const zend_op * old_opline_before_exception ;
103+ const zend_op * old_opline_before_exception = NULL ;
104104
105105 if (destructor -> op_array .fn_flags & (ZEND_ACC_PRIVATE |ZEND_ACC_PROTECTED )) {
106106 if (destructor -> op_array .fn_flags & ZEND_ACC_PRIVATE ) {
@@ -159,23 +159,26 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
159159 if (EG (exception ) == object ) {
160160 zend_error_noreturn (E_CORE_ERROR , "Attempt to destruct pending exception" );
161161 } else {
162- if (EG (current_execute_data )
163- && EG (current_execute_data )-> func
164- && ZEND_USER_CODE (EG (current_execute_data )-> func -> common .type )) {
165- zend_rethrow_exception (EG (current_execute_data ));
162+ if (EG (current_execute_data )) {
163+ if (EG (current_execute_data )-> func
164+ && ZEND_USER_CODE (EG (current_execute_data )-> func -> common .type )) {
165+ zend_rethrow_exception (EG (current_execute_data ));
166+ }
167+ EG (current_execute_data )-> opline = EG (opline_before_exception );
168+ old_opline_before_exception = EG (opline_before_exception );
166169 }
167- EG (current_execute_data )-> opline = EG (opline_before_exception );
168170 old_exception = EG (exception );
169- old_opline_before_exception = EG (opline_before_exception );
170171 EG (exception ) = NULL ;
171172 }
172173 }
173174
174175 zend_call_known_instance_method_with_0_params (destructor , object , NULL );
175176
176177 if (old_exception ) {
177- EG (current_execute_data )-> opline = EG (exception_op );
178- EG (opline_before_exception ) = old_opline_before_exception ;
178+ if (EG (current_execute_data )) {
179+ EG (current_execute_data )-> opline = EG (exception_op );
180+ EG (opline_before_exception ) = old_opline_before_exception ;
181+ }
179182 if (EG (exception )) {
180183 zend_exception_set_previous (EG (exception ), old_exception );
181184 } else {
0 commit comments