Browse Source

Merged PR 106: Fix nullptr dereference in InlineFunction

Fix nullptr dereference in InlineFunction

- Occurs in certain cases when function inliner is used
  without assumption cache available.
Tex Riddell 7 years ago
parent
commit
69fbecfc92
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Transforms/Utils/InlineFunction.cpp

+ 1 - 1
lib/Transforms/Utils/InlineFunction.cpp

@@ -1432,7 +1432,7 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI,
   if (PHI) {
     auto &DL = Caller->getParent()->getDataLayout();
     if (Value *V = SimplifyInstruction(PHI, DL, nullptr, nullptr,
-                                       &IFI.ACT->getAssumptionCache(*Caller))) {
+          IFI.ACT ? &IFI.ACT->getAssumptionCache(*Caller) : nullptr)) { // HLSL Change: fix nullptr dereference
       PHI->replaceAllUsesWith(V);
       PHI->eraseFromParent();
     }