@@ -121,7 +121,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
121121 }
122122
123123 zend_object * old_exception ;
124- const zend_op * old_opline_before_exception ;
124+ const zend_op * old_opline_before_exception = NULL ;
125125
126126 if (destructor -> op_array .fn_flags & (ZEND_ACC_PRIVATE |ZEND_ACC_PROTECTED )) {
127127 if (destructor -> op_array .fn_flags & ZEND_ACC_PRIVATE ) {
@@ -180,23 +180,26 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
180180 if (EG (exception ) == object ) {
181181 zend_error_noreturn (E_CORE_ERROR , "Attempt to destruct pending exception" );
182182 } else {
183- if (EG (current_execute_data )
184- && EG (current_execute_data )-> func
185- && ZEND_USER_CODE (EG (current_execute_data )-> func -> common .type )) {
186- zend_rethrow_exception (EG (current_execute_data ));
183+ if (EG (current_execute_data )) {
184+ if (EG (current_execute_data )-> func
185+ && ZEND_USER_CODE (EG (current_execute_data )-> func -> common .type )) {
186+ zend_rethrow_exception (EG (current_execute_data ));
187+ }
188+ EG (current_execute_data )-> opline = EG (opline_before_exception );
189+ old_opline_before_exception = EG (opline_before_exception );
187190 }
188- EG (current_execute_data )-> opline = EG (opline_before_exception );
189191 old_exception = EG (exception );
190- old_opline_before_exception = EG (opline_before_exception );
191192 EG (exception ) = NULL ;
192193 }
193194 }
194195
195196 zend_call_known_instance_method_with_0_params (destructor , object , NULL );
196197
197198 if (old_exception ) {
198- EG (current_execute_data )-> opline = EG (exception_op );
199- EG (opline_before_exception ) = old_opline_before_exception ;
199+ if (EG (current_execute_data )) {
200+ EG (current_execute_data )-> opline = EG (exception_op );
201+ EG (opline_before_exception ) = old_opline_before_exception ;
202+ }
200203 if (EG (exception )) {
201204 zend_exception_set_previous (EG (exception ), old_exception );
202205 } else {
0 commit comments