@@ -4430,17 +4430,18 @@ zval * ZEND_FASTCALL zend_handle_named_arg(
4430
4430
return arg ;
4431
4431
}
4432
4432
4433
- static void start_fake_frame (zend_execute_data * call , const zend_op * opline ) {
4434
- zend_execute_data * prev_execute_data = EG ( current_execute_data ) ;
4435
- call -> prev_execute_data = prev_execute_data ;
4433
+ static zend_execute_data * start_fake_frame (zend_execute_data * call , const zend_op * opline ) {
4434
+ zend_execute_data * old_prev_execute_data = call -> prev_execute_data ;
4435
+ call -> prev_execute_data = EG ( current_execute_data ) ;
4436
4436
call -> opline = opline ;
4437
4437
EG (current_execute_data ) = call ;
4438
+ return old_prev_execute_data ;
4438
4439
}
4439
4440
4440
- static void end_fake_frame (zend_execute_data * call ) {
4441
+ static void end_fake_frame (zend_execute_data * call , zend_execute_data * old_prev_execute_data ) {
4441
4442
zend_execute_data * prev_execute_data = call -> prev_execute_data ;
4442
4443
EG (current_execute_data ) = prev_execute_data ;
4443
- call -> prev_execute_data = NULL ;
4444
+ call -> prev_execute_data = old_prev_execute_data ;
4444
4445
if (UNEXPECTED (EG (exception )) && ZEND_USER_CODE (prev_execute_data -> func -> common .type )) {
4445
4446
zend_rethrow_exception (prev_execute_data );
4446
4447
}
@@ -4473,9 +4474,9 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal
4473
4474
* value is not accessible through back traces. */
4474
4475
zval tmp ;
4475
4476
ZVAL_COPY (& tmp , default_value );
4476
- start_fake_frame (call , opline );
4477
+ zend_execute_data * old = start_fake_frame (call , opline );
4477
4478
zend_result ret = zval_update_constant_ex (& tmp , fbc -> op_array .scope );
4478
- end_fake_frame (call );
4479
+ end_fake_frame (call , old );
4479
4480
if (UNEXPECTED (ret == FAILURE )) {
4480
4481
zval_ptr_dtor_nogc (& tmp );
4481
4482
return FAILURE ;
@@ -4490,9 +4491,9 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal
4490
4491
}
4491
4492
} else {
4492
4493
ZEND_ASSERT (opline -> opcode == ZEND_RECV );
4493
- start_fake_frame (call , opline );
4494
+ zend_execute_data * old = start_fake_frame (call , opline );
4494
4495
zend_argument_error (zend_ce_argument_count_error , i + 1 , "not passed" );
4495
- end_fake_frame (call );
4496
+ end_fake_frame (call , old );
4496
4497
return FAILURE ;
4497
4498
}
4498
4499
}
@@ -4513,25 +4514,25 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal
4513
4514
4514
4515
zend_internal_arg_info * arg_info = & fbc -> internal_function .arg_info [i ];
4515
4516
if (i < fbc -> common .required_num_args ) {
4516
- start_fake_frame (call , NULL );
4517
+ zend_execute_data * old = start_fake_frame (call , NULL );
4517
4518
zend_argument_error (zend_ce_argument_count_error , i + 1 , "not passed" );
4518
- end_fake_frame (call );
4519
+ end_fake_frame (call , old );
4519
4520
return FAILURE ;
4520
4521
}
4521
4522
4522
4523
zval default_value ;
4523
4524
if (zend_get_default_from_internal_arg_info (& default_value , arg_info ) == FAILURE ) {
4524
- start_fake_frame (call , NULL );
4525
+ zend_execute_data * old = start_fake_frame (call , NULL );
4525
4526
zend_argument_error (zend_ce_argument_count_error , i + 1 ,
4526
4527
"must be passed explicitly, because the default value is not known" );
4527
- end_fake_frame (call );
4528
+ end_fake_frame (call , old );
4528
4529
return FAILURE ;
4529
4530
}
4530
4531
4531
4532
if (Z_TYPE (default_value ) == IS_CONSTANT_AST ) {
4532
- start_fake_frame (call , NULL );
4533
+ zend_execute_data * old = start_fake_frame (call , NULL );
4533
4534
zend_result ret = zval_update_constant_ex (& default_value , fbc -> common .scope );
4534
- end_fake_frame (call );
4535
+ end_fake_frame (call , old );
4535
4536
if (ret == FAILURE ) {
4536
4537
return FAILURE ;
4537
4538
}
0 commit comments