From 3e96cd48efb89b29667020750586c132917a19fd Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Mon, 11 Jul 2016 11:40:32 +1000 Subject: [PATCH] rose: sanity check CHECK_BOUNDS instruction --- src/rose/rose_build_bytecode.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rose/rose_build_bytecode.cpp b/src/rose/rose_build_bytecode.cpp index c6f709bc..ecdda146 100644 --- a/src/rose/rose_build_bytecode.cpp +++ b/src/rose/rose_build_bytecode.cpp @@ -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;