summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2011-07-11 07:10:30 +0000
committerDmitry Stogov <dmitry@php.net>2011-07-11 07:10:30 +0000
commitf214fd4f7db216a9c97b32dbf4427f6c5b8a640d (patch)
treec1f78af9cd4678a2a68bce01398f0799aa87fc3f
parentc5901b64a725857bdf1f4dbb2581ef6a72aebc9d (diff)
downloadphp-git-f214fd4f7db216a9c97b32dbf4427f6c5b8a640d.tar.gz
Fixed bug #55150 (php -a segfaults)
-rw-r--r--Zend/zend_compile.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index dc8c5c8ae3..89d790e7e1 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -70,6 +70,10 @@
#define GET_CACHE_SLOT(literal) do { \
CG(active_op_array)->literals[literal].cache_slot = CG(active_op_array)->last_cache_slot++; \
+ if ((CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) && CG(active_op_array)->run_time_cache) { \
+ CG(active_op_array)->run_time_cache = erealloc(CG(active_op_array)->run_time_cache, CG(active_op_array)->last_cache_slot * sizeof(void*)); \
+ CG(active_op_array)->run_time_cache[CG(active_op_array)->last_cache_slot - 1] = NULL; \
+ } \
} while (0)
#define POLYMORPHIC_CACHE_SLOT_SIZE 2
@@ -77,6 +81,11 @@
#define GET_POLYMORPHIC_CACHE_SLOT(literal) do { \
CG(active_op_array)->literals[literal].cache_slot = CG(active_op_array)->last_cache_slot; \
CG(active_op_array)->last_cache_slot += POLYMORPHIC_CACHE_SLOT_SIZE; \
+ if ((CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) && CG(active_op_array)->run_time_cache) { \
+ CG(active_op_array)->run_time_cache = erealloc(CG(active_op_array)->run_time_cache, CG(active_op_array)->last_cache_slot * sizeof(void*)); \
+ CG(active_op_array)->run_time_cache[CG(active_op_array)->last_cache_slot - 1] = NULL; \
+ CG(active_op_array)->run_time_cache[CG(active_op_array)->last_cache_slot - 2] = NULL; \
+ } \
} while (0)
#define FREE_POLYMORPHIC_CACHE_SLOT(literal) do { \