mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
@@ -6952,6 +6952,10 @@ static int zend_jit_cmp(zend_jit_ctx *jit,
|
||||
} else {
|
||||
ir_MERGE_N(n, end_inputs->refs);
|
||||
}
|
||||
} else if (smart_branch_opcode && !exit_addr) {
|
||||
/* dead code */
|
||||
_zend_jit_add_predecessor_ref(jit, target_label, jit->b, ir_END());
|
||||
jit->b = -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
54
ext/opcache/tests/jit/cmp_009.phpt
Normal file
54
ext/opcache/tests/jit/cmp_009.phpt
Normal file
@@ -0,0 +1,54 @@
|
||||
--TEST--
|
||||
JIT CMP: 009 Wrong code generation for dead compare
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
$j = 0;
|
||||
for ($i = 0; $i < 20; $j++) {
|
||||
$a&=
|
||||
$a = $a.+
|
||||
$tojenthiss[$i = $v] = $s=
|
||||
$tojenthiss[$i = $v] = $s=
|
||||
$a&=
|
||||
$b =
|
||||
$b =
|
||||
$a = $a.+
|
||||
$obj->prop =
|
||||
$a = $a.+
|
||||
$obj->prop =
|
||||
$a = $a.+
|
||||
$Sojenthiss[$i = $v] = $s=
|
||||
$x!= $a ?: $c;
|
||||
$x!= $a ?: $c;
|
||||
$x!= $a ?: $c;
|
||||
$x!= $a ?: $c;
|
||||
$aZ = $a;
|
||||
$aZ = $a;
|
||||
$aZ = $a;
|
||||
$a = $a.+
|
||||
$a = $a.+
|
||||
$x!= $a ?: $c;
|
||||
$aZ = $a;
|
||||
$a = $a.+
|
||||
$a = $a.+
|
||||
$obj->prop =
|
||||
$a = $a.+
|
||||
$Sojenthiss[$i = $v] = $s=
|
||||
$x!= $a ?: $c;
|
||||
$x!= $a ?: $c;
|
||||
$aZ = $a;
|
||||
}
|
||||
}
|
||||
@test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Attempt to assign property "prop" on null in %scmp_009.php:15
|
||||
Stack trace:
|
||||
#0 %scmp_009.php(39): test()
|
||||
#1 {main}
|
||||
thrown in %scmp_009.php on line 15
|
||||
Reference in New Issue
Block a user