Fix UB: can't bind a reference to nullptr (NFC)
[oota-llvm.git] / lib / Transforms / Scalar / LoopUnswitch.cpp
index 8aa3c887c2435ed675cedb184cc0456ca705b9ef..a00603bd22fc9b1d257e6e3d9159cdf46e282413 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);