]> granicus.if.org Git - php/commitdiff
Fixed bug #55150 (php -a segfaults)
authorDmitry Stogov <dmitry@php.net>
Mon, 11 Jul 2011 07:10:30 +0000 (07:10 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 11 Jul 2011 07:10:30 +0000 (07:10 +0000)
Zend/zend_compile.c

index dc8c5c8ae3bee1f09c45796157ac98d20c65f2c5..89d790e7e1af28983e24373f9873e8f3f3d7dc06 100644 (file)
 
 #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
 #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 { \