diff --git a/src/java_bytecode/java_bytecode_convert_method.cpp b/src/java_bytecode/java_bytecode_convert_method.cpp index b834efc4d5c..9cda1dd2c65 100644 --- a/src/java_bytecode/java_bytecode_convert_method.cpp +++ b/src/java_bytecode/java_bytecode_convert_method.cpp @@ -45,6 +45,9 @@ Author: Daniel Kroening, kroening@kroening.com #include #include +/// Given a string of the format '?blah?', will return true when compared +/// against a string that matches appart from any characters that are '?' +/// in the original string. Equivalent to doing a regex match on '.blah.' class patternt { public: diff --git a/src/java_bytecode/java_bytecode_parser.cpp b/src/java_bytecode/java_bytecode_parser.cpp index 4b71fd29f13..0db26a5ec06 100644 --- a/src/java_bytecode/java_bytecode_parser.cpp +++ b/src/java_bytecode/java_bytecode_parser.cpp @@ -79,6 +79,7 @@ class java_bytecode_parsert:public parsert if(index==0 || index>=constant_pool.size()) { error() << "invalid constant pool index (" << index << ")" << eom; + error() << "constant pool size: " << constant_pool.size() << eom; throw 0; } @@ -946,6 +947,12 @@ void java_bytecode_parsert::rmethod_attribute(methodt &method) { u2 start_pc=read_u2(); u2 end_pc=read_u2(); + + INVARIANT( + start_pc < end_pc, + "The start_pc must be less than the end_pc as this is the range the " + "exception is active"); + u2 handler_pc=read_u2(); u2 catch_type=read_u2(); method.exception_table[e].start_pc=start_pc;