Exception: Unexpected label context
Chen Liang
chen.l.liang at oracle.com
Thu Jul 18 19:18:23 UTC 2024
Hi Oystein,
Can you provide a minimal reproduction case for this problem? The stacktrace you've provided looks eerily similar to another one where CodeTransform reads labels it doesn't know because our transform chaining was not propagating the Labels correctly. (Fixed in 23 and 24 very recently)
- Chen
________________________________
From: classfile-api-dev <classfile-api-dev-retn at openjdk.org> on behalf of Øystein Myhre Andersen <o.myhre at gmail.com>
Sent: Tuesday, July 16, 2024 5:30 AM
To: classfile-api-dev <classfile-api-dev at openjdk.org>
Subject: Exception: Unexpected label context
I got:
Exception in thread "main" java.lang.IllegalStateException: Unexpected label context CodeBuilder[id=1816757085] in =CodeBuilder[id=1730173572]
at ... DirectCodeBuilder.labelToBci(DirectCodeBuilder.java:702)
at ... DirectCodeBuilder.writeLabelOffset(DirectCodeBuilder.java:465)
at ... DirectCodeBuilder.writeTableSwitch(DirectCodeBuilder.java:577)
I did some tests and found that bci had become greater than the max short value.
I guessed the Method was too big. Then I split it up.
That solved the problem !
Perhaps 'labelToBci' should check if bci became too large and in that case give an error: "Method too large"
- Øystein Myhre Andersen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20240718/40217fcd/attachment.htm>
More information about the classfile-api-dev
mailing list