From: Xinchen Hui Date: Fri, 18 Dec 2015 09:41:42 +0000 (+0800) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.1.0alpha1~617^2~210^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f47e9872ed8ec9a125862e182f9e0068adf6f5a;p=php Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: Improved fix for #71127 Conflicts: ext/opcache/Optimizer/pass1_5.c --- 2f47e9872ed8ec9a125862e182f9e0068adf6f5a diff --cc ext/opcache/Optimizer/pass1_5.c index 7e0d14ac60,4229f13ebe..24c28e976e --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@@ -42,9 -16,8 +42,8 @@@ void zend_optimizer_pass1(zend_op_arra int i = 0; zend_op *opline = op_array->opcodes; zend_op *end = opline + op_array->last; - /* bug #71127* - zend_bool collect_constants = (op_array == &ctx->script->main_op_array); */ - zend_bool collect_constants = 0; + zend_bool collect_constants = (ZEND_OPTIMIZER_PASS_15 & OPTIMIZATION_LEVEL)? - (op_array == &script->main_op_array) : 0; ++ (op_array == &ctx->script->main_op_array) : 0; while (opline < end) { switch (opline->opcode) { diff --cc ext/opcache/Optimizer/zend_optimizer.h index 27c6159b7d,f4e441790f..8c1b8eace8 --- a/ext/opcache/Optimizer/zend_optimizer.h +++ b/ext/opcache/Optimizer/zend_optimizer.h @@@ -36,9 -36,10 +36,10 @@@ #define ZEND_OPTIMIZER_PASS_9 (1<<8) /* TMP VAR usage */ #define ZEND_OPTIMIZER_PASS_10 (1<<9) /* NOP removal */ #define ZEND_OPTIMIZER_PASS_11 (1<<10) /* Merge equal constants */ -#define ZEND_OPTIMIZER_PASS_12 (1<<11) +#define ZEND_OPTIMIZER_PASS_12 (1<<11) /* Adjust used stack */ #define ZEND_OPTIMIZER_PASS_13 (1<<12) #define ZEND_OPTIMIZER_PASS_14 (1<<13) + #define ZEND_OPTIMIZER_PASS_15 (1<<14) /* Collect constants */ #define ZEND_OPTIMIZER_ALL_PASSES 0xFFFFFFFF