summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_compile.h2
-rw-r--r--Zend/zend_execute_API.c1
-rw-r--r--Zend/zend_vm_def.h4
-rw-r--r--Zend/zend_vm_execute.h4
4 files changed, 6 insertions, 5 deletions
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index b3ba352df8..90c5c8b613 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -468,7 +468,7 @@ struct _zend_execute_data {
#define ZEND_CALL_TOP (1 << 1)
#define ZEND_CALL_FREE_EXTRA_ARGS (1 << 2) /* equal to IS_TYPE_REFCOUNTED */
#define ZEND_CALL_CTOR (1 << 3)
-/* Unused flag (1 << 4) */
+#define ZEND_CALL_FREE_SYMBOL_TABLE (1 << 4)
#define ZEND_CALL_CLOSURE (1 << 5)
#define ZEND_CALL_RELEASE_THIS (1 << 6)
#define ZEND_CALL_ALLOCATED (1 << 7)
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index dc2ce46a7b..c83761cf89 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1480,6 +1480,7 @@ ZEND_API zend_array *zend_rebuild_symbol_table(void) /* {{{ */
return ex->symbol_table;
}
+ ZEND_ADD_CALL_FLAG(ex, ZEND_CALL_FREE_SYMBOL_TABLE);
if (EG(symtable_cache_ptr) >= EG(symtable_cache)) {
/*printf("Cache hit! Reusing %x\n", symtable_cache[symtable_cache_ptr]);*/
symbol_table = ex->symbol_table = *(EG(symtable_cache_ptr)--);
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 2557509381..b4303954ce 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2521,7 +2521,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
zend_object *object;
i_free_compiled_variables(execute_data);
- if (UNEXPECTED(EX(symbol_table) != NULL)) {
+ if (UNEXPECTED(call_info & ZEND_CALL_FREE_SYMBOL_TABLE)) {
zend_clean_and_cache_symbol_table(EX(symbol_table));
}
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
@@ -2579,7 +2579,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
} else {
if (ZEND_CALL_KIND_EX(call_info) == ZEND_CALL_TOP_FUNCTION) {
i_free_compiled_variables(execute_data);
- if (UNEXPECTED(EX(symbol_table) != NULL)) {
+ if (UNEXPECTED(call_info & ZEND_CALL_FREE_SYMBOL_TABLE)) {
zend_clean_and_cache_symbol_table(EX(symbol_table));
}
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index ac7ac1580e..69df98c660 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -478,7 +478,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
zend_object *object;
i_free_compiled_variables(execute_data);
- if (UNEXPECTED(EX(symbol_table) != NULL)) {
+ if (UNEXPECTED(call_info & ZEND_CALL_FREE_SYMBOL_TABLE)) {
zend_clean_and_cache_symbol_table(EX(symbol_table));
}
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
@@ -536,7 +536,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
} else {
if (ZEND_CALL_KIND_EX(call_info) == ZEND_CALL_TOP_FUNCTION) {
i_free_compiled_variables(execute_data);
- if (UNEXPECTED(EX(symbol_table) != NULL)) {
+ if (UNEXPECTED(call_info & ZEND_CALL_FREE_SYMBOL_TABLE)) {
zend_clean_and_cache_symbol_table(EX(symbol_table));
}
zend_vm_stack_free_extra_args_ex(call_info, execute_data);