[PATCH] Verification of invoke statepoints
    Philip Reames 
    listmail at philipreames.com
       
    Thu Feb  5 10:24:59 PST 2015
    
    
  
REPOSITORY
  rL LLVM
================
Comment at: lib/IR/Verifier.cpp:2772
@@ +2771,3 @@
+    // This is case for relocate on the unwinding path of an invoke statepoint
+    if (isa<ExtractValueInst>(CI.getArgOperand(0))) {
+      Assert1(isa<LandingPadInst>(
----------------
I'd suggest using dyn_cast here.  It will simplify several parts of the following code.
================
Comment at: lib/IR/Verifier.cpp:2787
@@ +2786,3 @@
+              cast<Instruction>(CI.getArgOperand(0))->getParent());
+      Assert1(invokeBB->getTerminator(),
+              "safepoint block should be well formed",
----------------
I think this is checked elsewhere.
================
Comment at: lib/IR/Verifier.cpp:2798
@@ +2797,3 @@
+      // relocates of a call statepoint
+      Assert2(isStatepoint(cast<Instruction>(CI.getArgOperand(0))),
+              "gc relocate is incorrectly tied to the statepoint",
----------------
The cast needs to be check in a way you don't crash here.  :)
auto Op0 = ...
isa<Instruction>(Op0) && ...
================
Comment at: lib/IR/Verifier.cpp:2806
@@ -2767,1 +2805,3 @@
+    GCRelocateOperands ops(&CI);
+    ImmutableCallSite StatepointCS = ImmutableCallSite(ops.statepoint());
 
----------------
This can be more cleanly written as:
ImmutableCallSite StatepointCS(ops.statepoint());
http://reviews.llvm.org/D7366
EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
    
    
More information about the llvm-commits
mailing list