summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-02-22 13:42:13 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-02-22 13:42:13 +0100
commitdda2074bf7bb8a6514b2c29cbf543b8d09ee0603 (patch)
treeecdc87fa09dfd493507a25c98864216b134197c7 /ext
parentea115a617fea566bda787ad77ae9f9d0396da203 (diff)
parent66fda0cdb1937ba1c3c5bfaebf2523b7978dd8f3 (diff)
downloadphp-git-dda2074bf7bb8a6514b2c29cbf543b8d09ee0603.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'ext')
-rw-r--r--ext/opcache/Optimizer/dfa_pass.c1
-rw-r--r--ext/opcache/tests/opt/jmp_001.phpt30
2 files changed, 31 insertions, 0 deletions
diff --git a/ext/opcache/Optimizer/dfa_pass.c b/ext/opcache/Optimizer/dfa_pass.c
index 14c1527fc5..58f5f50085 100644
--- a/ext/opcache/Optimizer/dfa_pass.c
+++ b/ext/opcache/Optimizer/dfa_pass.c
@@ -830,6 +830,7 @@ optimize_jmpnz:
MAKE_NOP(opline);
removed_ops++;
take_successor_1(ssa, block_num, block);
+ zend_ssa_remove_result_def(ssa, ssa_op);
goto optimize_nop;
}
}
diff --git a/ext/opcache/tests/opt/jmp_001.phpt b/ext/opcache/tests/opt/jmp_001.phpt
new file mode 100644
index 0000000000..3ec84ed658
--- /dev/null
+++ b/ext/opcache/tests/opt/jmp_001.phpt
@@ -0,0 +1,30 @@
+--TEST--
+JMP 001: JMP_SET with constant arg
+--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 test() {
+ $var = null;
+ $var = $var ?: test2();
+ return $var;
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %s:1-8
+L0 (8): RETURN int(1)
+
+test: ; (lines=4, args=0, vars=1, tmps=1)
+ ; (after optimizer)
+ ; %s:2-6
+L0 (4): INIT_FCALL_BY_NAME 0 string("test2")
+L1 (4): V1 = DO_FCALL_BY_NAME
+L2 (4): CV0($var) = QM_ASSIGN V1
+L3 (5): RETURN CV0($var)