mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
When splitting a basic block, retranslate
This commit should fix some bugs due to the fact that when we're splitting a basic block we don't retranslate the basic block at the split point but preserve the existing code. This lead to problems, in particular in x86-64 where certain QEMU local variables were not available. This change should fix it. Basically, every time we split a basic block in `JumpTargetManager::registerJT` we note down that the new basic block must be purged, and in `JumpTargetManager::harvest` we perform the purge. `harvest` has been chosen since it's a particularly quiet moment, i.e., there should be no pending references/iterator to code we have to delete.
This commit is contained in:
@@ -632,6 +632,7 @@ void CodeGenerator::translate(uint64_t VirtualAddress) {
|
||||
while (Entry != nullptr) {
|
||||
Builder.SetInsertPoint(Entry);
|
||||
|
||||
// TODO: what if create a new instance of an InstructionTranslator here?
|
||||
Translator.reset();
|
||||
|
||||
// TODO: rename this type
|
||||
|
||||
Reference in New Issue
Block a user