summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-03-14 22:57:49 +0330
committerAndreas Kling <kling@serenityos.org>2022-03-14 22:28:53 +0100
commit0b8d2fb62f65027b1ece7d26fcb62583a49d1ae0 (patch)
tree52066a6e1e4de89fd0d33868fb5920be2a0b54fb /Userland
parent1f9d76c7b8ffe4d1a672a3d9210042f93eae9f3d (diff)
downloadserenity-0b8d2fb62f65027b1ece7d26fcb62583a49d1ae0.zip
LibJS/Bytecode: Replace merged block references before copying them
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp b/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp
index a97cad2c28..e80d7f7029 100644
--- a/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp
@@ -135,6 +135,8 @@ void MergeBlocks::perform(PassPipelineExecutable& executable)
auto new_block = BasicBlock::create(builder.build(), size);
auto& block = *new_block;
+ auto first_successor_position = replace_blocks(successors, *new_block);
+ VERIFY(first_successor_position.has_value());
size_t last_successor_index = successors.size() - 1;
for (size_t i = 0; i < successors.size(); ++i) {
@@ -152,8 +154,6 @@ void MergeBlocks::perform(PassPipelineExecutable& executable)
block.grow(copy_end);
}
- auto first_successor_position = replace_blocks(successors, *new_block);
- VERIFY(first_successor_position.has_value());
executable.executable.basic_blocks.insert(*first_successor_position, move(new_block));
}