mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
DLATypeSystem: fix use-after-poison false positive
This commit fixes a use-after-poison false-positive report from ASAN. This was due to misuse of SpecificBumpPtrAllocator together with __asan_poison_memory_region. The region was poisoned but not deallocated, which caused a the false positive when trying to destroy and deallocate it in the destructor of LayoutTypeSystem. This was fixed by switching to plain BumpPtrAllocator, and properly calling the Deallocate method, which wraps its own battle-tested ASAN logic.
This commit is contained in:
@@ -641,7 +641,7 @@ void LayoutTypeSystem::mergeNodes(const LayoutTypeSystemNodePtrVec &ToMerge) {
|
||||
// Remove From from Layouts
|
||||
bool Erased = Layouts.erase(From);
|
||||
revng_assert(Erased);
|
||||
__asan_poison_memory_region(From, sizeof(LayoutTypeSystemNode));
|
||||
NodeAllocator.Deallocate(From);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,7 +675,7 @@ void LayoutTypeSystem::removeNode(LayoutTypeSystemNode *ToRemove) {
|
||||
|
||||
bool Erased = Layouts.erase(ToRemove);
|
||||
revng_assert(Erased);
|
||||
__asan_poison_memory_region(ToRemove, sizeof(LayoutTypeSystemNode));
|
||||
NodeAllocator.Deallocate(ToRemove);
|
||||
}
|
||||
|
||||
static void moveEdgesWithoutSumming(LayoutTypeSystemNode *OldSrc,
|
||||
|
||||
Reference in New Issue
Block a user