com php-src: Fixed yet another object aliasing problem: ext/opcache/Optimizer/escape_analysis.c ext/opcache/tests /opt/sccp_020.phpt
| From: | Dmitry Stogov | Date: | Mon, 11 Sep 2017 20:19:03 +0000 |
| Subject: | com php-src: Fixed yet another object aliasing problem: ext/opcache/Optimizer/escape_analysis.c ext/opcache/tests /opt/sccp_020.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99356@lists.php.net to get a copy of this message | ||
Commit: 86dd321c0c14497f1e72e711fbbb157f2fc9b345
Author: Dmitry Stogov <dmitry@zend.com> Mon, 11 Sep 2017 23:19:03 +0300
Parents: 63b93b4a744dba1c9eba0ad0fe34fa9237381226
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=86dd321c0c14497f1e72e711fbbb157f2fc9b345
Log:
Fixed yet another object aliasing problem
Changed paths:
M ext/opcache/Optimizer/escape_analysis.c
A ext/opcache/tests/opt/sccp_020.phpt
Diff:
diff --git a/ext/opcache/Optimizer/escape_analysis.c b/ext/opcache/Optimizer/escape_analysis.c
index db70bbc..7f5169c 100644
--- a/ext/opcache/Optimizer/escape_analysis.c
+++ b/ext/opcache/Optimizer/escape_analysis.c
@@ -285,7 +285,7 @@ static int is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int va
/* reference dependencies processed separately */
break;
case ZEND_ASSIGN:
- if (opline->op2_type == IS_CV) {
+ if (opline->op2_type == IS_CV || opline->result_type != IS_UNUSED) {
if (OP2_INFO() & MAY_BE_OBJECT) {
/* object aliasing */
return 1;
diff --git a/ext/opcache/tests/opt/sccp_020.phpt b/ext/opcache/tests/opt/sccp_020.phpt
new file mode 100644
index 0000000..41c694a
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_020.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SCCP 020: Object assignemnt
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+;opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo() {
+ $b = $a = new stdClass;
+ $a->x = 5;
+ $b->x = 42;
+ echo $a->x;
+ echo "\n";
+}
+foo();
+?>
+--EXPECT--
+42