mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-14 01:04:38 +03: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: https://github.com/SerenityOS/serenity/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 ✅
@ -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…
Reference in New Issue
Block a user