Don't forget to reconstruct D after changing the scope that we're
looking at.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141892 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/LexicalScopes.cpp b/lib/CodeGen/LexicalScopes.cpp
index 02fa525..a12e1a3 100644
--- a/lib/CodeGen/LexicalScopes.cpp
+++ b/lib/CodeGen/LexicalScopes.cpp
@@ -150,8 +150,10 @@
/// getOrCreateRegularScope - Find or create a regular lexical scope.
LexicalScope *LexicalScopes::getOrCreateRegularScope(MDNode *Scope) {
DIDescriptor D = DIDescriptor(Scope);
- if (D.isLexicalBlockFile())
+ if (D.isLexicalBlockFile()) {
Scope = DILexicalBlockFile(Scope).getScope();
+ D = DIDescriptor(Scope);
+ }
LexicalScope *WScope = LexicalScopeMap.lookup(Scope);
if (WScope)