@@ -1145,7 +1145,9 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper
1145
1145
LOAD_NEXT_OPLINE();
1146
1146
ZEND_VM_LEAVE();
1147
1147
} else if (EXPECTED((call_info & ZEND_CALL_TOP) == 0)) {
1148
- zend_detach_symbol_table(execute_data);
1148
+ if (EX(func)->op_array.last_var > 0) {
1149
+ zend_detach_symbol_table(execute_data);
1150
+ }
1149
1151
zend_destroy_static_vars(&EX(func)->op_array);
1150
1152
destroy_op_array(&EX(func)->op_array);
1151
1153
efree_size(EX(func), sizeof(zend_op_array));
@@ -1156,7 +1158,9 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper
1156
1158
execute_data = EG(current_execute_data) = EX(prev_execute_data);
1157
1159
zend_vm_stack_free_call_frame_ex(call_info, old_execute_data);
1158
1160
1159
- zend_attach_symbol_table(execute_data);
1161
+ if (EX(func)->op_array.last_var > 0) {
1162
+ zend_attach_symbol_table(execute_data);
1163
+ }
1160
1164
if (UNEXPECTED(EG(exception) != NULL)) {
1161
1165
zend_rethrow_exception(execute_data);
1162
1166
HANDLE_EXCEPTION_LEAVE();
@@ -1187,11 +1191,14 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper
1187
1191
} else /* if (call_kind == ZEND_CALL_TOP_CODE) */ {
1188
1192
zend_array *symbol_table = EX(symbol_table);
1189
1193
1190
- zend_detach_symbol_table(execute_data);
1194
+ if (EX(func)->op_array.last_var > 0) {
1195
+ zend_detach_symbol_table(execute_data);
1196
+ }
1191
1197
old_execute_data = EX(prev_execute_data);
1192
1198
while (old_execute_data) {
1193
1199
if (old_execute_data->func && (ZEND_CALL_INFO(old_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
1194
- if (old_execute_data->symbol_table == symbol_table) {
1200
+ if (old_execute_data->symbol_table == symbol_table
1201
+ && old_execute_data->func->op_array.last_var > 0) {
1195
1202
zend_attach_symbol_table(old_execute_data);
1196
1203
}
1197
1204
break;
@@ -55398,7 +55405,9 @@ ZEND_API void execute_ex(zend_execute_data *ex)
55398
55405
LOAD_NEXT_OPLINE();
55399
55406
ZEND_VM_LEAVE();
55400
55407
} else if (EXPECTED((call_info & ZEND_CALL_TOP) == 0)) {
55401
- zend_detach_symbol_table(execute_data);
55408
+ if (EX(func)->op_array.last_var > 0) {
55409
+ zend_detach_symbol_table(execute_data);
55410
+ }
55402
55411
zend_destroy_static_vars(&EX(func)->op_array);
55403
55412
destroy_op_array(&EX(func)->op_array);
55404
55413
efree_size(EX(func), sizeof(zend_op_array));
@@ -55409,7 +55418,9 @@ ZEND_API void execute_ex(zend_execute_data *ex)
55409
55418
execute_data = EG(current_execute_data) = EX(prev_execute_data);
55410
55419
zend_vm_stack_free_call_frame_ex(call_info, old_execute_data);
55411
55420
55412
- zend_attach_symbol_table(execute_data);
55421
+ if (EX(func)->op_array.last_var > 0) {
55422
+ zend_attach_symbol_table(execute_data);
55423
+ }
55413
55424
if (UNEXPECTED(EG(exception) != NULL)) {
55414
55425
zend_rethrow_exception(execute_data);
55415
55426
HANDLE_EXCEPTION_LEAVE();
@@ -55440,11 +55451,14 @@ ZEND_API void execute_ex(zend_execute_data *ex)
55440
55451
} else /* if (call_kind == ZEND_CALL_TOP_CODE) */ {
55441
55452
zend_array *symbol_table = EX(symbol_table);
55442
55453
55443
- zend_detach_symbol_table(execute_data);
55454
+ if (EX(func)->op_array.last_var > 0) {
55455
+ zend_detach_symbol_table(execute_data);
55456
+ }
55444
55457
old_execute_data = EX(prev_execute_data);
55445
55458
while (old_execute_data) {
55446
55459
if (old_execute_data->func && (ZEND_CALL_INFO(old_execute_data) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
55447
- if (old_execute_data->symbol_table == symbol_table) {
55460
+ if (old_execute_data->symbol_table == symbol_table
55461
+ && old_execute_data->func->op_array.last_var > 0) {
55448
55462
zend_attach_symbol_table(old_execute_data);
55449
55463
}
55450
55464
break;
0 commit comments