# HG changeset patch # User Peter Mehlitz # Date 1431371838 25200 # Node ID 8aded593a50fd7e6ce786e333f8f5e9830796cad # Parent 4eb191cbb68c2546b289d07f9eee12aa9976922d fixed the missing class init status update for native clinits. Since we moved that to the clinit RETURN in r24, it has to be duplicated in NATIVERETURN for native clinits. Factoring out to DIRECTCALLRETURN is not an option since there is no good way to determine if the direct call included a clinit (we would have to look at the code, which is suboptimal performance- and change resilience-wise). Thanks to Franz Weitl for the report diff -r 4eb191cbb68c -r 8aded593a50f src/main/gov/nasa/jpf/jvm/bytecode/NATIVERETURN.java --- a/src/main/gov/nasa/jpf/jvm/bytecode/NATIVERETURN.java Mon May 04 22:10:33 2015 -0700 +++ b/src/main/gov/nasa/jpf/jvm/bytecode/NATIVERETURN.java Mon May 11 12:17:18 2015 -0700 @@ -59,6 +59,14 @@ setReturnAttr(ti, retAttr); } + if (mi.isClinit()) { + // this is in the clinit RETURN insn for non-MJIs so we have to duplicate here + // Duplication could be avoided in DIRECTCALLRETURN, but there is no reliable + // way to check if the direct call did return from a clinit since the corresponding + // synthetic method could do anything + mi.getClassInfo().setInitialized(); + } + return frame.getPC().getNext(); } diff -r 4eb191cbb68c -r 8aded593a50f src/main/gov/nasa/jpf/jvm/bytecode/RETURN.java --- a/src/main/gov/nasa/jpf/jvm/bytecode/RETURN.java Mon May 04 22:10:33 2015 -0700 +++ b/src/main/gov/nasa/jpf/jvm/bytecode/RETURN.java Mon May 11 12:17:18 2015 -0700 @@ -49,6 +49,8 @@ } } else if (mi.isClinit()) { + // this also needs to happen in NATIVERETURN for native clinits. See comment + // there why we can't refactor this into DIRECTCALLRETURN mi.getClassInfo().setInitialized(); }