summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2400ba6)
raw | patch | inline | side by side (parent: 2400ba6)
author | Adrian Prantl <aprantl@apple.com> | |
Mon, 13 Oct 2014 20:44:58 +0000 (20:44 +0000) | ||
committer | Adrian Prantl <aprantl@apple.com> | |
Mon, 13 Oct 2014 20:44:58 +0000 (20:44 +0000) |
Broken parent scope pointers in inlined DIVariables can cause
ensureAbstractVariableIsCreated to insert new abstract scopes, thus
invalidating the iterator in this loop and leading to hard-to-debug
crashes. Useful when manually reducing IR for testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219628 91177308-0d34-0410-b5e6-96231b3b80d8
ensureAbstractVariableIsCreated to insert new abstract scopes, thus
invalidating the iterator in this loop and leading to hard-to-debug
crashes. Useful when manually reducing IR for testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219628 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | patch | blob | history |
index 491681aafd275aa744659574e06bdeb322c3e3d3..6e641884d76e4a04511e1d5165b8a8209550f70f 100644 (file)
return;
}
+#ifndef NDEBUG
+ size_t NumAbstractScopes = LScopes.getAbstractScopesList().size();
+#endif
// Construct abstract scopes.
for (LexicalScope *AScope : LScopes.getAbstractScopesList()) {
DISubprogram SP(AScope->getScopeNode());
if (!ProcessedVars.insert(DV))
continue;
ensureAbstractVariableIsCreated(DV, DV.getContext());
+ assert(LScopes.getAbstractScopesList().size() == NumAbstractScopes
+ && "ensureAbstractVariableIsCreated inserted abstract scopes");
}
constructAbstractSubprogramScopeDIE(AScope);
}