[llvm] r277360 - [Verifier] Resume instructions can only be in functions w/ a personality

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 11:06:35 PDT 2016


Author: majnemer
Date: Mon Aug  1 13:06:34 2016
New Revision: 277360

URL: http://llvm.org/viewvc/llvm-project?rev=277360&view=rev
Log:
[Verifier] Resume instructions can only be in functions w/ a personality

This fixes PR28799.

Modified:
    llvm/trunk/lib/IR/Verifier.cpp
    llvm/trunk/test/Transforms/ObjCARC/path-overflow.ll

Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=277360&r1=277359&r2=277360&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Mon Aug  1 13:06:34 2016
@@ -428,6 +428,7 @@ private:
   void visitInsertValueInst(InsertValueInst &IVI);
   void visitEHPadPredecessors(Instruction &I);
   void visitLandingPadInst(LandingPadInst &LPI);
+  void visitResumeInst(ResumeInst &RI);
   void visitCatchPadInst(CatchPadInst &CPI);
   void visitCatchReturnInst(CatchReturnInst &CatchReturn);
   void visitCleanupPadInst(CleanupPadInst &CPI);
@@ -3298,6 +3299,21 @@ void Verifier::visitLandingPadInst(Landi
   visitInstruction(LPI);
 }
 
+void Verifier::visitResumeInst(ResumeInst &RI) {
+  Assert(RI.getFunction()->hasPersonalityFn(),
+         "ResumeInst needs to be in a function with a personality.", &RI);
+
+  if (!LandingPadResultTy)
+    LandingPadResultTy = RI.getValue()->getType();
+  else
+    Assert(LandingPadResultTy == RI.getValue()->getType(),
+           "The resume instruction should have a consistent result type "
+           "inside a function.",
+           &RI);
+
+  visitTerminatorInst(RI);
+}
+
 void Verifier::visitCatchPadInst(CatchPadInst &CPI) {
   BasicBlock *BB = CPI.getParent();
 

Modified: llvm/trunk/test/Transforms/ObjCARC/path-overflow.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ObjCARC/path-overflow.ll?rev=277360&r1=277359&r2=277360&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ObjCARC/path-overflow.ll (original)
+++ llvm/trunk/test/Transforms/ObjCARC/path-overflow.ll Mon Aug  1 13:06:34 2016
@@ -341,7 +341,7 @@ msgSend.cont507:
 }
 
 ; Function Attrs: optsize ssp uwtable
-define void @test2() unnamed_addr align 2 {
+define void @test2() unnamed_addr align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
 bb:
   br i1 undef, label %bb3, label %bb2
 




More information about the llvm-commits mailing list