diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -3362,7 +3362,7 @@ // in its name so that we can reference the variable in the command line // of the VS debugger. std::string QualifiedName = - (moduleIsInFortran() || isa(Scope)) + (moduleIsInFortran() || (Scope && isa(Scope))) ? std::string(DIGV->getName()) : getFullyQualifiedName(Scope, DIGV->getName());