[llvm] r248213 - Fix UB: can't bind a reference to nullptr (NFC)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 14:29:44 PDT 2015


Author: mehdi_amini
Date: Mon Sep 21 16:29:43 2015
New Revision: 248213

URL: http://llvm.org/viewvc/llvm-project?rev=248213&view=rev
Log:
Fix UB: can't bind a reference to nullptr (NFC)

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=248213&r1=248212&r2=248213&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Mon Sep 21 16:29:43 2015
@@ -419,7 +419,7 @@ bool LoopUnswitch::runOnLoop(Loop *L, LP
   Function *F = currentLoop->getHeader()->getParent();
   bool Changed = false;
   do {
-    assert(currentLoop->isLCSSAForm(*DT));
+    assert(!DT || currentLoop->isLCSSAForm(*DT));
     redoLoop = false;
     Changed |= processCurrentLoop();
   } while(redoLoop);




More information about the llvm-commits mailing list