Commit 6282022
committed
Fix leak with EXT_STMT when pipe result is unused
This example would leak:
function x() {
return range(0, 10);
}
function test($a, $b) {
$a |> $b;
}
test(42, x(...));
because we were missing a FREE in test(). This requires two fixes, namely one in
zend_do_free() to skip over the EXT_STMT usage, and another in
zend_optimize_block() to avoid removing the FREE opcode by removing the result
def of the declaring opcode.1 parent 1eaa527 commit 6282022
2 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
423 | 431 | | |
424 | 432 | | |
425 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
824 | | - | |
| 824 | + | |
| 825 | + | |
825 | 826 | | |
826 | 827 | | |
827 | 828 | | |
| |||
0 commit comments