[PATCH] Fix for crash during SjLj preparation step

Bill Wendling isanbard at gmail.com
Wed Jul 9 22:43:44 PDT 2014


================
Comment at: lib/CodeGen/SjLjEHPrepare.cpp:255
@@ +254,3 @@
+      // to handle them differently.
+      // We use select i8 true, %arg, undef to achieve the same goal
+      Value *TrueValue = ConstantInt::getTrue(F.getContext());
----------------
Nit: You don't need the line break before this sentence. :-)

================
Comment at: lib/CodeGen/SjLjEHPrepare.cpp:258
@@ +257,3 @@
+      Value *UndefValue = UndefValue::get(Ty);
+      Instruction *SI = SelectInst::Create(TrueValue, AI, UndefValue, AI->getName() + ".tmp",  AfterAllocaInsPt);
+      AI->replaceAllUsesWith(SI);
----------------
Watch out for 80-column violations here.

================
Comment at: lib/CodeGen/SjLjEHPrepare.cpp:265
@@ -266,3 +264,3 @@
       // so src and destination types are identical. BitCast is the only
       // possibility.
       CastInst *NC = new BitCastInst(AI, AI->getType(), AI->getName() + ".tmp",
----------------
Now that we have the above code, I think we can use it for this situation as well. However, you can do that as a separate commit.

http://reviews.llvm.org/D4256






More information about the llvm-commits mailing list