RFR: 8335664: Parsing jsr broken: assert(bci>= 0 && bci < c->method()->code_size()) failed: index out of bounds [v2]

Matias Saavedra Silva matsaave at openjdk.org
Wed Aug 21 19:33:46 UTC 2024


> Although JSR bytecodes cannot be generated by javac anymore, a classfile generated with a tool like JASM can still contain this bytecode. Should a program end with a JSR, there will be undefined behavior since the bytecode reads the address of the next instruction. In the case of Hotspot, this leads to a crash when generating oop maps. This fixes the calculation of basic blocks. 
> 
> The early exploration of this issue was done by @eme64 who also generated a reproducer.

Matias Saavedra Silva has updated the pull request incrementally with two additional commits since the last revision:

 - Removed incorrect comment and added copyright
 - Added regression test

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20645/files
  - new: https://git.openjdk.org/jdk/pull/20645/files/dd8de52d..622b77b9

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20645&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20645&range=00-01

  Stats: 113 lines in 4 files changed: 112 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/20645.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20645/head:pull/20645

PR: https://git.openjdk.org/jdk/pull/20645


More information about the hotspot-dev mailing list