mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
AsmPrinter: Check subprogram before using it
Check return of `getDISubprogram()` before using it. A WIP patch makes `DIDescriptor` accessors more strict (and would crash on this). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232838 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -190,8 +190,11 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
|
|||||||
return;
|
return;
|
||||||
assert(FI.End && "Don't know where the function ends?");
|
assert(FI.End && "Don't know where the function ends?");
|
||||||
|
|
||||||
StringRef FuncName = getDISubprogram(GV).getDisplayName(),
|
StringRef GVName = GV->getName();
|
||||||
GVName = GV->getName();
|
StringRef FuncName;
|
||||||
|
if (DISubprogram SP = getDISubprogram(GV))
|
||||||
|
FuncName = SP.getDisplayName();
|
||||||
|
|
||||||
// FIXME Clang currently sets DisplayName to "bar" for a C++
|
// FIXME Clang currently sets DisplayName to "bar" for a C++
|
||||||
// "namespace_foo::bar" function, see PR21528. Luckily, dbghelp.dll is trying
|
// "namespace_foo::bar" function, see PR21528. Luckily, dbghelp.dll is trying
|
||||||
// to demangle display names anyways, so let's just put a mangled name into
|
// to demangle display names anyways, so let's just put a mangled name into
|
||||||
|
Reference in New Issue
Block a user