mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:07:35 +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
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