@@ -1147,19 +1147,21 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper
1147
1147
} else if (EXPECTED((call_info & ZEND_CALL_TOP) == 0)) {
1148
1148
if (EX(func)->op_array.last_var > 0) {
1149
1149
zend_detach_symbol_table(execute_data);
1150
+ call_info |= ZEND_CALL_NEEDS_REATTACH;
1150
1151
}
1151
1152
zend_destroy_static_vars(&EX(func)->op_array);
1152
1153
destroy_op_array(&EX(func)->op_array);
1153
1154
efree_size(EX(func), sizeof(zend_op_array));
1154
- #ifdef ZEND_PREFER_RELOAD
1155
- call_info = EX_CALL_INFO();
1156
- #endif
1157
1155
old_execute_data = execute_data;
1158
1156
execute_data = EG(current_execute_data) = EX(prev_execute_data);
1159
1157
zend_vm_stack_free_call_frame_ex(call_info, old_execute_data);
1160
1158
1161
- if (EX(func)->op_array.last_var > 0) {
1162
- zend_attach_symbol_table(execute_data);
1159
+ if (call_info & ZEND_CALL_NEEDS_REATTACH) {
1160
+ if (EX(func)->op_array.last_var > 0) {
1161
+ zend_attach_symbol_table(execute_data);
1162
+ } else {
1163
+ ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_NEEDS_REATTACH);
1164
+ }
1163
1165
}
1164
1166
if (UNEXPECTED(EG(exception) != NULL)) {
1165
1167
zend_rethrow_exception(execute_data);
@@ -1193,17 +1195,23 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper
1193
1195
1194
1196
if (EX(func)->op_array.last_var > 0) {
1195
1197
zend_detach_symbol_table(execute_data);
1196
- }
1197
- old_execute_data = EX(prev_execute_data);
1198
- while (old_execute_data) {
1199
- if (old_execute_data->func && (ZEND_CALL_INFO(old_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
1200
- if (old_execute_data->symbol_table == symbol_table
1201
- && old_execute_data->func->op_array.last_var > 0) {
1202
- zend_attach_symbol_table(old_execute_data);
1198
+ call_info |= ZEND_CALL_NEEDS_REATTACH;
1199
+ }
1200
+ if (call_info & ZEND_CALL_NEEDS_REATTACH) {
1201
+ old_execute_data = EX(prev_execute_data);
1202
+ while (old_execute_data) {
1203
+ if (old_execute_data->func && (ZEND_CALL_INFO(old_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
1204
+ if (old_execute_data->symbol_table == symbol_table) {
1205
+ if (old_execute_data->func->op_array.last_var > 0) {
1206
+ zend_attach_symbol_table(old_execute_data);
1207
+ } else {
1208
+ ZEND_ADD_CALL_FLAG(old_execute_data, ZEND_CALL_NEEDS_REATTACH);
1209
+ }
1210
+ }
1211
+ break;
1203
1212
}
1204
- break ;
1213
+ old_execute_data = old_execute_data->prev_execute_data ;
1205
1214
}
1206
- old_execute_data = old_execute_data->prev_execute_data;
1207
1215
}
1208
1216
EG(current_execute_data) = EX(prev_execute_data);
1209
1217
ZEND_VM_RETURN();
@@ -55455,19 +55463,21 @@ ZEND_API void execute_ex(zend_execute_data *ex)
55455
55463
} else if (EXPECTED((call_info & ZEND_CALL_TOP) == 0)) {
55456
55464
if (EX(func)->op_array.last_var > 0) {
55457
55465
zend_detach_symbol_table(execute_data);
55466
+ call_info |= ZEND_CALL_NEEDS_REATTACH;
55458
55467
}
55459
55468
zend_destroy_static_vars(&EX(func)->op_array);
55460
55469
destroy_op_array(&EX(func)->op_array);
55461
55470
efree_size(EX(func), sizeof(zend_op_array));
55462
- #ifdef ZEND_PREFER_RELOAD
55463
- call_info = EX_CALL_INFO();
55464
- #endif
55465
55471
old_execute_data = execute_data;
55466
55472
execute_data = EG(current_execute_data) = EX(prev_execute_data);
55467
55473
zend_vm_stack_free_call_frame_ex(call_info, old_execute_data);
55468
55474
55469
- if (EX(func)->op_array.last_var > 0) {
55470
- zend_attach_symbol_table(execute_data);
55475
+ if (call_info & ZEND_CALL_NEEDS_REATTACH) {
55476
+ if (EX(func)->op_array.last_var > 0) {
55477
+ zend_attach_symbol_table(execute_data);
55478
+ } else {
55479
+ ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_NEEDS_REATTACH);
55480
+ }
55471
55481
}
55472
55482
if (UNEXPECTED(EG(exception) != NULL)) {
55473
55483
zend_rethrow_exception(execute_data);
@@ -55501,17 +55511,23 @@ ZEND_API void execute_ex(zend_execute_data *ex)
55501
55511
55502
55512
if (EX(func)->op_array.last_var > 0) {
55503
55513
zend_detach_symbol_table(execute_data);
55504
- }
55505
- old_execute_data = EX(prev_execute_data);
55506
- while (old_execute_data) {
55507
- if (old_execute_data->func && (ZEND_CALL_INFO(old_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
55508
- if (old_execute_data->symbol_table == symbol_table
55509
- && old_execute_data->func->op_array.last_var > 0) {
55510
- zend_attach_symbol_table(old_execute_data);
55514
+ call_info |= ZEND_CALL_NEEDS_REATTACH;
55515
+ }
55516
+ if (call_info & ZEND_CALL_NEEDS_REATTACH) {
55517
+ old_execute_data = EX(prev_execute_data);
55518
+ while (old_execute_data) {
55519
+ if (old_execute_data->func && (ZEND_CALL_INFO(old_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
55520
+ if (old_execute_data->symbol_table == symbol_table) {
55521
+ if (old_execute_data->func->op_array.last_var > 0) {
55522
+ zend_attach_symbol_table(old_execute_data);
55523
+ } else {
55524
+ ZEND_ADD_CALL_FLAG(old_execute_data, ZEND_CALL_NEEDS_REATTACH);
55525
+ }
55526
+ }
55527
+ break;
55511
55528
}
55512
- break ;
55529
+ old_execute_data = old_execute_data->prev_execute_data ;
55513
55530
}
55514
- old_execute_data = old_execute_data->prev_execute_data;
55515
55531
}
55516
55532
EG(current_execute_data) = EX(prev_execute_data);
55517
55533
ZEND_VM_RETURN();
0 commit comments