]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
rose: sanity check CHECK_BOUNDS instruction
authorJustin Viiret <justin.viiret@intel.com>
Mon, 11 Jul 2016 01:40:32 +0000 (11:40 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 10 Aug 2016 04:57:36 +0000 (14:57 +1000)
src/rose/rose_build_bytecode.cpp

index c6f709bc2465da7453ac59df669973c3c89f2023..ecdda146468de4db04c29ace6eae5a7411ea2c03 100644 (file)
@@ -3766,6 +3766,10 @@ void makeRoleCheckBounds(const RoseBuildImpl &build, RoseVertex v,
         max_bound = MAX_OFFSET;
     }
 
+    // This instruction should be doing _something_ -- bounds should be tighter
+    // than just {length, inf}.
+    assert(min_bound > lit_length || max_bound < MAX_OFFSET);
+
     auto ri = RoseInstruction(ROSE_INSTR_CHECK_BOUNDS, JumpTarget::NEXT_BLOCK);
     ri.u.checkBounds.min_bound = min_bound;
     ri.u.checkBounds.max_bound = max_bound;