mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +00:00
LibJS: Don't mark blocks for unification multiple times
This would cause a UAF otherwise
This commit is contained in:
parent
35db0c5e18
commit
7697e09660
Notes:
sideshowbarker
2024-07-18 00:41:35 +09:00
Author: https://github.com/Hendiadyoin1
Commit: 7697e09660
Pull-request: https://github.com/SerenityOS/serenity/pull/15971
Reviewed-by: https://github.com/FireFox317
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
1 changed files with 2 additions and 0 deletions
|
@ -24,6 +24,8 @@ void UnifySameBlocks::perform(PassPipelineExecutable& executable)
|
|||
auto& block = executable.executable.basic_blocks[i];
|
||||
auto block_bytes = block.instruction_stream();
|
||||
for (auto& candidate_block : executable.executable.basic_blocks.span().slice(i + 1)) {
|
||||
if (equal_blocks.contains(&*candidate_block))
|
||||
continue;
|
||||
// FIXME: This can probably be relaxed a bit...
|
||||
if (candidate_block->size() != block.size())
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue