bug
bug copied to clipboard
Inliner crash on Java 17 when using `-release`
object crash {
def main(args: Array[String]): Unit = {
val algo = "HmacSHA1"
val charset = java.nio.charset.StandardCharsets.UTF_8
val key = "totally secret key".getBytes(charset)
val value = "totally real value".getBytes(charset)
val mac = javax.crypto.Mac.getInstance(algo)
mac.init(new javax.crypto.spec.SecretKeySpec(key, algo))
val macced = mac.doFinal(value)
println(new String(macced, charset))
}
}
â sandbox sc -release 11 -opt:l:inline -opt-inline-from:'**' Test.scala
error: java.lang.IndexOutOfBoundsException
at scala.tools.asm.tree.InsnList.get(InsnList.java:94)
Reported on https://users.scala-lang.org/t/solved-indexoutofboundsexception-in-scala-2-13-8-inliner/8583/4
The linked PR uses retronym's clever hook to tweak the optimizer class path.
I didn't immediately see a way to handle "instructions are empty" in a graceful manner.