Skip to content

Commit

Permalink
Merge branch 'PHP-5.6' into PHP-7.0
Browse files Browse the repository at this point in the history
* PHP-5.6:
  Improved fix for #71127

Conflicts:
	ext/opcache/Optimizer/pass1_5.c
  • Loading branch information
laruence committed Dec 18, 2015
2 parents 4e01269 + 4070279 commit 2f47e98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions ext/opcache/Optimizer/pass1_5.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
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 == &ctx->script->main_op_array) : 0;

while (opline < end) {
switch (opline->opcode) {
Expand Down
3 changes: 2 additions & 1 deletion ext/opcache/Optimizer/zend_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
#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

#define DEFAULT_OPTIMIZATION_LEVEL "0xFFFFFFFF"
#define DEFAULT_OPTIMIZATION_LEVEL "0xFFFFBFFF"

#endif
1 change: 1 addition & 0 deletions ext/opcache/tests/bug71127.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Bug #71127 (Define in auto_prepend_file is overwrite)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=0xFFFFBFFF
--SKIPIF--
<?php if (!extension_loaded('Zend OPcache')) die("skip"); ?>
--FILE--
Expand Down

0 comments on commit 2f47e98

Please sign in to comment.