return inside try + pattern-match inside finally causes VerifyError #7407
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7407?orig=1 |
@magarciaEPFL said:
The problem does not surface in the new backend (ok, after fixing a typo) because a more structured approach is followed to emit try-catch-finally, |
Leif Warner (pdxleif) said: java.lang.VerifyError: Instruction type does not match stack map
Exception Details:
Location:
.foo()Ljava/lang/String; @20: aload_1
Reason:
Current frame's stack size doesn't match stackmap.
Current Frame:
bci: @20
flags: { }
locals: { '', 'java/lang/Throwable', integer, 'scala/runtime/BoxedUnit' }
stack: { }
Stackmap Frame:
bci: @20
flags: { }
locals: { '', top, integer, 'scala/runtime/BoxedUnit' }
stack: { 'java/lang/String' }
Bytecode:
0000000: 1210 100a 3db2 0016 4ea7 000b 4c10 0a3d
0000010: b200 164e 2bbf
Exception Handler Table:
bci [0, 2] => handler: 12
Stackmap Table:
same_locals_1_stack_item_frame(@12,Object[#25])
full_frame(@20,{Object[#2],Top,Integer,Object[#18]},{Object[#27]})
at .<init>(<console>:7)
at .<clinit>(<console>)
at $print(<console>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:734) |
@lrytz said: Test case was added in 2a659cf0, updated in scala/scala#4068 |
@retronym said: |
This was referenced Apr 7, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When upgrading to 2.9.2. to 2.10.1, ran into this.
Minimal test case:
throws
when accessed.
Seems to be the combination of return in the try and the pattern match in the finally that does it.
Looks like James Iry blogged about something related, recently:
http://james-iry.blogspot.com/2013/01/scala-trycatch-lifting-proposal.html
The text was updated successfully, but these errors were encountered: