diff -r e42c27026290 -r d137ce373c4c src/share/classes/com/sun/tools/javac/jvm/Gen.java --- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java Thu Jun 27 16:04:05 2013 +0100 +++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java Thu Jun 27 16:06:56 2013 +0100 @@ -1783,7 +1783,16 @@ r.load(); code.emitop0(ireturn + Code.truncate(Code.typecode(pt))); } else { + /* If we have a statement like: + * + * return; + * + * we need to store the code.pendingStatPos value before generating + * the finalizer. + */ + int tmpPos = code.pendingStatPos; targetEnv = unwind(env.enclMethod, env); + code.pendingStatPos = tmpPos; code.emitop0(return_); } endFinalizerGaps(env, targetEnv);