[PATCH] D17154: Bug fix: use dyn_cast_or_null instead of dyn_cast

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 13:33:54 PST 2016


mcrosier added inline comments.

================
Comment at: lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp:829
@@ -829,2 +828,3 @@
+  GetElementPtrInst *SecondGEP = dyn_cast_or_null<GetElementPtrInst>(ResultPtr);
   if (isSwapCandidate && isLegalToSwapOperand(FirstGEP, SecondGEP, L))
     swapGEPOperand(FirstGEP, SecondGEP);
----------------
I believe you still need to add the nullptr checks for FirstGEP and SecondGEP.


Repository:
  rL LLVM

http://reviews.llvm.org/D17154





More information about the llvm-commits mailing list