Skip to content

Commit b017f76

Browse files
Andrew LuGoeLin
authored andcommitted
8210168: JCK test .vm.classfmt.ins.code__002.code__00201m1.code__00201m1 hangs with -noverify
Check for 'bc_length > 0' to handle lengths of -1. Backport-of: d36066f
1 parent c4faab6 commit b017f76

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hotspot/share/interpreter/rewriter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ void Rewriter::scan_method(Method* method, bool reverse, bool* invokespecial_err
400400
}
401401
}
402402

403-
assert(bc_length != 0, "impossible bytecode length");
403+
// Continuing with an invalid bytecode will fail in the loop below.
404+
// So guarantee here.
405+
guarantee(bc_length > 0, "Verifier should have caught this invalid bytecode");
404406

405407
switch (c) {
406408
case Bytecodes::_lookupswitch : {

0 commit comments

Comments
 (0)