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

Harold Seigel hseigel at openjdk.java.net
Mon Mar 1 16:04:17 UTC 2021


> Please review this small change to fix some verifier error messages.  If a method's descriptor has a void return signature, but contains a bytecode such as 'ireturn' or 'areturn'. then it will get a VerifyError exception with the message "Method descriptor has a void return type".   Conversely, if a method's descriptor has a non-void return signature, but contains a 'return' bytecode then it will get a VerifyError exception with the message "Method descriptor has a non-void return type".
> 
> A sample error message looks like:
> Error: Unable to initialize main class Hi
> Caused by: java.lang.VerifyError: Method descriptor has a void return type
> Exception Details:
>   Location:
>     Hi.noRet(I)V @1: ireturn
>   Reason:
>     Type integer (current frame, stack[0]) is not assignable to top (from method signature)
>   Current Frame:
>     bci: @1
>     flags: { }
>     locals: { integer }
>     stack: { integer }
>   Bytecode:
>     0000000: 08ac
> 
> The fix was tested with Mach5 tiers 1 and 2 on Linux, Mac OS, and Windows, tiers 3-5 on Linux x64. and the JCK Lang and VM tests on Linux x64.
> 
> Thanks, Harold

Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:

  changed error message text

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2757/files
  - new: https://git.openjdk.java.net/jdk/pull/2757/files/a8105158..fd837481

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2757&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2757&range=00-01

  Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2757.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2757/head:pull/2757

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


More information about the hotspot-runtime-dev mailing list