From dc84daf7e8a8ae5eb5a57ed9dbbcc763d5f29cee Mon Sep 17 00:00:00 2001 From: Pietro Fezzardi Date: Wed, 3 Feb 2021 12:00:04 +0100 Subject: [PATCH] DLATypeSystem: add assertion on mergeNodes The mergeNodes API is not guaranteed to work properly if the 2 merged nodes are the same. This commit adds an assertion to rule this situation out. --- lib/Decompiler/DLATypeSystem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Decompiler/DLATypeSystem.cpp b/lib/Decompiler/DLATypeSystem.cpp index dc3f65e6a..1c12bfd9c 100644 --- a/lib/Decompiler/DLATypeSystem.cpp +++ b/lib/Decompiler/DLATypeSystem.cpp @@ -471,6 +471,7 @@ inline void LayoutTypeSystem::mergeNodes(LayoutTypeSystemNode *From, LayoutTypeSystemNode *Into, llvm::SmallSet *IntoTypePtrs) { + revng_assert(From != Into); revng_log(MergeLog, "Merging: " << From << " Into: " << Into); auto LayoutIt = Layouts.find(From); revng_assert(LayoutIt != Layouts.end());