1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-28 21:02:07 +00:00

LibJS: Remeber which instruction terminated a block

This commit is contained in:
Hendiadyoin1 2022-11-26 14:42:36 +01:00 committed by Ali Mohammad Pur
parent 8c4717fc6e
commit 192897c269
2 changed files with 6 additions and 5 deletions

View file

@ -57,7 +57,7 @@ public:
grow(sizeof(OpType));
new (slot) OpType(forward<Args>(args)...);
if constexpr (OpType::IsTerminator)
m_current_basic_block->terminate({});
m_current_basic_block->terminate({}, static_cast<Instruction const*>(slot));
return *static_cast<OpType*>(slot);
}
@ -76,7 +76,7 @@ public:
grow(size_to_allocate);
new (slot) OpType(forward<Args>(args)...);
if constexpr (OpType::IsTerminator)
m_current_basic_block->terminate({});
m_current_basic_block->terminate({}, static_cast<Instruction const*>(slot));
return *static_cast<OpType*>(slot);
}