com php-src: Fixed bug #72762: NEWS ext/opcache/Optimizer/zend _inference.c ext/opcache/tests/bug72762.phpt
| From: | Nikita Popov | Date: | Fri, 05 Aug 2016 14:27:55 +0000 |
| Subject: | com php-src: Fixed bug #72762: NEWS ext/opcache/Optimizer/zend _inference.c ext/opcache/tests/bug72762.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93622@lists.php.net to get a copy of this message | ||
Commit: fc7c81ff5484f28221c89be0847ea521b707aa8c
Author: Nikita Popov <nikic@php.net> Fri, 5 Aug 2016 16:27:55 +0200
Parents: 03d03243fa09634895378923b53360e40a608c82
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fc7c81ff5484f28221c89be0847ea521b707aa8c
Log:
Fixed bug #72762
Bugs:
https://bugs.php.net/72762
Changed paths:
M NEWS
M ext/opcache/Optimizer/zend_inference.c
A ext/opcache/tests/bug72762.phpt
Diff:
diff --git a/NEWS b/NEWS
index 19ee69d..6a1588b 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,10 @@ PHP NEWS
. Fixed bug #72711 (
mb_ereg does not clear the $regs parameter on
failure). (ju1ius)
+- Opcache:
+ . Fixed bug #72762 (Infinite loop while parsing a file with opcache enabled).
+ (Nikita)
+
- Stream:
. Fixed bug #72743 (Out-of-bound read in php_stream_filter_create).
(Loianhtuan)
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c
index c8dd100..20f2ae3 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -3139,9 +3139,6 @@ static void zend_update_type_info(const zend_op_array *op_array,
if (t1 & MAY_BE_ARRAY_KEY_STRING) {
tmp |= MAY_BE_STRING;
}
- if (!(tmp & (MAY_BE_LONG|MAY_BE_STRING))) {
- tmp |= MAY_BE_NULL;
- }
}
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
}
diff --git a/ext/opcache/tests/bug72762.phpt b/ext/opcache/tests/bug72762.phpt
new file mode 100644
index 0000000..8ce98bf
--- /dev/null
+++ b/ext/opcache/tests/bug72762.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #72762: Infinite loop while parsing a file with opcache enabled
+--FILE--
+<?php
+
+class foo
+{
+ function bar()
+ {
+ $b = array();
+
+ foreach ($a as $a) {
+ foreach ($b as $k => $v) {
+ }
+ $b[$k] = $v;
+ }
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+===DONE===