-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the attached test case we ended up not updating a leftover MATCH jump in the unreachable_free block. There's different ways this can be addressed, but in this case we can just make sure that a new block is started after the loop free, which will allow it to be dropped as unreachable. We only need to retain the free itself for live-range reconstruction. Fixes oss-fuzz #39516.
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Corrupted CFG due to unreachable free with match | ||
--FILE-- | ||
<?php | ||
function test() { | ||
var_dump(match(x){}); | ||
match(y){ | ||
3, 4 => 5, | ||
}; | ||
} | ||
try { | ||
test(); | ||
} catch (Error $e) { | ||
echo $e->getMessage(), "\n"; | ||
} | ||
?> | ||
--EXPECT-- | ||
Undefined constant "x" |