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.
This commit is contained in:
Pietro Fezzardi
2021-02-03 12:00:04 +01:00
parent 42b9fb97e7
commit dc84daf7e8
+1
View File
@@ -471,6 +471,7 @@ inline void
LayoutTypeSystem::mergeNodes(LayoutTypeSystemNode *From,
LayoutTypeSystemNode *Into,
llvm::SmallSet<LayoutTypePtr, 2> *IntoTypePtrs) {
revng_assert(From != Into);
revng_log(MergeLog, "Merging: " << From << " Into: " << Into);
auto LayoutIt = Layouts.find(From);
revng_assert(LayoutIt != Layouts.end());