From: Dmitry Stogov Date: Mon, 13 Jan 2014 12:16:23 +0000 (+0400) Subject: Fixed bug #66440 (Optimisation of conditional JMPs based on pre-evaluate constant... X-Git-Tag: php-5.6.0alpha1~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b74dc4a07a2c5178cbedc41b0beedd979537ffa;p=php Fixed bug #66440 (Optimisation of conditional JMPs based on pre-evaluate constant function calls) --- diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 8f76c63d96..577d1b6609 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -433,7 +433,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { zval t; if (zend_get_persistent_constant(Z_STRVAL(ZEND_OP1_LITERAL(opline - 1)), - Z_STRLEN(ZEND_OP1_LITERAL(opline - 1)), &t, 0 TSRMLS_CC)) { + Z_STRLEN(ZEND_OP1_LITERAL(opline - 1)), &t, 1 TSRMLS_CC)) { if (replace_var_by_const(op_array, opline + 1, ZEND_RESULT(opline).var, &t TSRMLS_CC)) { literal_dtor(&ZEND_OP1_LITERAL(opline - 1)); MAKE_NOP((opline - 1)); diff --git a/ext/opcache/tests/bug66440.phpt b/ext/opcache/tests/bug66440.phpt new file mode 100644 index 0000000000..b546e32b3c --- /dev/null +++ b/ext/opcache/tests/bug66440.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #66440 (Optimisation of conditional JMPs based on pre-evaluate constant function calls) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +opcache.file_update_protection=0 +--SKIPIF-- + +--FILE-- +