OSDN Git Service

[mips][FastISel] Fix a nullptr deference.
authorSimon Dardis <simon.dardis@imgtec.com>
Sat, 29 Apr 2017 16:31:40 +0000 (16:31 +0000)
committerSimon Dardis <simon.dardis@imgtec.com>
Sat, 29 Apr 2017 16:31:40 +0000 (16:31 +0000)
r301392 introduced a potential nullptr deference causing compilation
failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301746 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsFastISel.cpp

index d1ec77e..21c99da 100644 (file)
@@ -1263,7 +1263,8 @@ bool MipsFastISel::finishCall(CallLoweringInfo &CLI, MVT RetVT,
     MipsCCState CCInfo(CC, false, *FuncInfo.MF, RVLocs, *Context);
 
     CCInfo.AnalyzeCallResult(CLI.Ins, RetCC_Mips, CLI.RetTy,
-                             CLI.Symbol->getName().data());
+                             CLI.Symbol ? CLI.Symbol->getName().data()
+                                        : nullptr);
 
     // Only handle a single return value.
     if (RVLocs.size() != 1)