diff --git a/lib/CodeGen/LexicalScopes.cpp b/lib/CodeGen/LexicalScopes.cpp index 02fa52527dd..a12e1a36d11 100644 --- a/lib/CodeGen/LexicalScopes.cpp +++ b/lib/CodeGen/LexicalScopes.cpp @@ -150,8 +150,10 @@ LexicalScope *LexicalScopes::getOrCreateLexicalScope(DebugLoc DL) { /// 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)