RFR: 8262368: wrong verifier message for bogus return type [v2]

Harold Seigel hseigel at openjdk.java.net
Tue Mar 2 15:26:42 UTC 2021


On Tue, 2 Mar 2021 05:37:52 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   changed error message text
>
> 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

-------------

PR: https://git.openjdk.java.net/jdk/pull/2757


More information about the hotspot-runtime-dev mailing list