Permalink
Browse files

Merge branch 'opcache' of ../php5.5

* 'opcache' of ../php5.5:
  Fixed bug #66474 (Optimizer bug in constant string to boolean conversion)
  • Loading branch information...
2 parents cde7e7e + 6bbd955 commit 00d00b141e969e4021bd374d603843a13305e4ad @dstogov dstogov committed Jan 13, 2014
Showing with 19 additions and 0 deletions.
  1. +1 −0 Optimizer/block_pass.c
  2. +18 −0 tests/bug66474.phpt
View
@@ -1057,6 +1057,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
/* BOOL */
result = ZEND_OP1_LITERAL(opline);
convert_to_boolean(&result);
+ Z_TYPE(ZEND_OP1_LITERAL(opline)) = IS_NULL;
}
PZ_SET_REFCOUNT_P(&result, 1);
PZ_UNSET_ISREF_P(&result);
View
@@ -0,0 +1,18 @@
+--TEST--
+Bug #66474 (Optimizer bug in constant string to boolean conversion)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.file_update_protection=0
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo() {
+ $speed = 'slow' || 'fast';
+}
+foo();
+echo "ok\n";
+--EXPECT--
+ok

0 comments on commit 00d00b1

Please sign in to comment.