svn: /php/php-src/ branches/PHP_5_4/Zend/zend_compile.c trunk/Zend/zend_compile.c
| From: | Dmitry Stogov | Date: | Mon, 11 Jul 2011 07:10:30 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_4/Zend/zend_compile.c trunk/Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-65450@lists.php.net to get a copy of this message | ||
dmitry Mon, 11 Jul 2011 07:10:30 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=313125
Log:
Fixed bug #55150 (php -a segfaults)
Bug: https://bugs.php.net/55150 (Assigned) php -a segfaults
Changed paths:
U php/php-src/branches/PHP_5_4/Zend/zend_compile.c
U php/php-src/trunk/Zend/zend_compile.c
Modified: php/php-src/branches/PHP_5_4/Zend/zend_compile.c
===================================================================
--- php/php-src/branches/PHP_5_4/Zend/zend_compile.c 2011-07-11 06:32:41 UTC (rev 313124)
+++ php/php-src/branches/PHP_5_4/Zend/zend_compile.c 2011-07-11 07:10:30 UTC (rev 313125)
@@ -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 { \
Modified: php/php-src/trunk/Zend/zend_compile.c
===================================================================
--- php/php-src/trunk/Zend/zend_compile.c 2011-07-11 06:32:41 UTC (rev 313124)
+++ php/php-src/trunk/Zend/zend_compile.c 2011-07-11 07:10:30 UTC (rev 313125)
@@ -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 { \