Fix UB: can't bind a reference to nullptr (NFC)
authorMehdi Amini <mehdi.amini@apple.com>
Mon, 21 Sep 2015 21:29:43 +0000 (21:29 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Mon, 21 Sep 2015 21:29:43 +0000 (21:29 +0000)
From: Mehdi Amini <mehdi.amini@apple.com>

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

lib/Transforms/Scalar/LoopUnswitch.cpp

index 8aa3c88..a00603b 100644 (file)
@@ -419,7 +419,7 @@ bool LoopUnswitch::runOnLoop(Loop *L, LPPassManager &LPM_Ref) {
   Function *F = currentLoop->getHeader()->getParent();
   bool Changed = false;
   do {
-    assert(currentLoop->isLCSSAForm(*DT));
+    assert(!DT || currentLoop->isLCSSAForm(*DT));
     redoLoop = false;
     Changed |= processCurrentLoop();
   } while(redoLoop);