summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-10 17:25:04 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-10 17:25:40 +0200
commite7a83ec8dff962ea624508f18b9b10f5add030cc (patch)
treedea5d55063b46059007cc740fe8c2838451c3df9 /Zend/tests
parent3fa9f9cfae2cedd7b6d26b6487dd156321243ab7 (diff)
downloadphp-git-e7a83ec8dff962ea624508f18b9b10f5add030cc.tar.gz
Fix bug #78271
When cleaning nops in the dfa pass, we were always keeping the smart branch inhibiting nop that occurs directly before the jump instruction. However, as we skip unreachable blocks entirely, it may happen that we need to keep a nop that occurs further back, prior to the unreachable blocks. Account for that case now. We should really do something about the smart branch situation, this is very fragile...
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/bug78271.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/Zend/tests/bug78271.phpt b/Zend/tests/bug78271.phpt
new file mode 100644
index 0000000000..fbbe016d75
--- /dev/null
+++ b/Zend/tests/bug78271.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #78271: Invalid result of if-else
+--FILE--
+<?
+function test($a, $b){
+ if ($a==10) {
+ $w="x";
+ } else {
+ $w="y";
+ }
+
+ if ($b) {
+ $d1="none";
+ $d2="block";
+ } else {
+ $d1="block";
+ $d2="none";
+ }
+
+ echo $d2.$b."\n";
+
+}
+
+test(1, 1);
+?>
+--EXPECT--
+block1