I have ~30 Scala 2.13.8 work projects (so no source immediately available) that are getting updated to compile and run on JDK 17. We have an SBT plugin that sets identical scalacOptions
for all of them. Most work just fine, but 3 have triggered the same IndexOutOfBoundsException
while inlining. The same code with the same options compiles just fine using JDK 11.
[error] java.lang.IndexOutOfBoundsException
[error] at scala.tools.asm.tree.InsnList.get(InsnList.java:94)
[error] at scala.tools.nsc.backend.jvm.analysis.BackendUtils$.computeMaxLocalsMaxStack(BackendUtils.scala:727)
[error] at scala.tools.nsc.backend.jvm.analysis.BackendUtils$.maxLocals(BackendUtils.scala:635)
[error] at scala.tools.nsc.backend.jvm.opt.Inliner.inlineCallsite(Inliner.scala:856)
[error] at scala.tools.nsc.backend.jvm.opt.Inliner.$anonfun$runInliner$10(Inliner.scala:352)
[info] * -deprecation
[info] * -encoding
[info] * utf-8
[info] * -feature
[info] * -unchecked
[info] * -explaintypes
[info] * -language:existentials
[info] * -language:experimental.macros
[info] * -language:higherKinds
[info] * -Xcheckinit
[info] * -Xlint:_,-missing-interpolator
[info] * -Xverify
[info] * -Yrangepos
[info] * -release
[info] * 11
[info] * -target:11
[info] * -Wdead-code
[info] * -Wextra-implicit
[info] * -Wnumeric-widen
[info] * -Woctal-literal
[info] * -Wunused:imports
[info] * -Wunused:patvars
[info] * -Wunused:privates
[info] * -Wunused:locals
[info] * -Wunused:explicits
[info] * -Wunused:implicits
[info] * -Wunused:synthetics
[info] * -Wunused:-nowarn
[info] * -Wvalue-discard
[info] * -Xasync
[info] * -Xsource:3
[info] * -Ytasty-reader
[info] * -opt:l:inline
[info] * -opt-inline-from:**,!java.**
[info] * -opt-warnings:none
[info] * -Werror
I have not found anything similar on the scala/bug repo. Has anyone seen this before or have idea what would trigger it? I’m working to create a minimal repro but since I have no clue what would cause it I’m basically doing a bunch of guess-and-check work.