RFR: 8262368: wrong verifier message for bogus return type [v2]
David Holmes
dholmes at openjdk.java.net
Wed Mar 3 04:47:59 UTC 2021
On Tue, 2 Mar 2021 15:23:48 GMT, Harold Seigel <hseigel at openjdk.org> wrote:
>> src/hotspot/share/classfile/verifier.cpp line 3152:
>>
>>> 3150: verify_error(ErrorContext::bad_type(bci,
>>> 3151: current_frame->stack_top_ctx(), TypeOrigin::signature(return_type)),
>>> 3152: "Method does not expect a return value");
>>
>> You've changed the wrong line. This one does expect a return value
>
> Hi David,
> If a method's descriptor has a void return type, but the method contains a bytecode such as areturn, then I think the message "Method does not expect a return type" is correct. Perhaps the word 'expect' is ambiguous? If so, then I think a more explicit message, similar to my original suggestion, should be used.
> Harold
Okay I see now the original bug report was incorrect and the referenced code is correct. But the above code is actually incorrect and now fixed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2757
More information about the hotspot-runtime-dev
mailing list