Skip to content

Commit edf0c6a

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #80194
2 parents a74c25b + 683c988 commit edf0c6a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Zend/tests/bug80194.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
Bug #80194: Assertion failure during block assembly of unreachable free with leading nop
3+
--FILE--
4+
<?php
5+
6+
function test($x) {
7+
switch ($x->y) {
8+
default:
9+
throw new Exception;
10+
case 'foobar':
11+
return new stdClass();
12+
break;
13+
}
14+
}
15+
16+
$x = (object)['y' => 'foobar'];
17+
var_dump(test($x));
18+
19+
?>
20+
--EXPECT--
21+
object(stdClass)#2 (0) {
22+
}

ext/opcache/Optimizer/block_pass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
19011901

19021902
/* Eliminate NOPs */
19031903
for (b = blocks; b < end; b++) {
1904-
if (b->flags & ZEND_BB_REACHABLE) {
1904+
if (b->flags & (ZEND_BB_REACHABLE|ZEND_BB_UNREACHABLE_FREE)) {
19051905
strip_nops(op_array, b);
19061906
}
19071907
}

0 commit comments

Comments
 (0)