Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VerifyError under -Yinline -Yinline-handlers #7589

Closed
scabug opened this issue Jun 19, 2013 · 4 comments
Closed

VerifyError under -Yinline -Yinline-handlers #7589

scabug opened this issue Jun 19, 2013 · 4 comments

Comments

@scabug
Copy link

scabug commented Jun 19, 2013

object Test {
  object RE extends RuntimeException

  def await0: Unit =
    if (false) {
      if (false) await0
    } else throw RE

  def body = {
    try {
      await0
    } catch {
      case e: Throwable 
        new Some((None getOrElse this).getClass)
        throw e
    }
  }

  def main(args: Array[String]) {
    try { body } catch {
      case RE => // okay
    }
  }
}

{noformat}
JAVA_HOME=$JAVA8_HOME qbin/scala -nc -Yinline -Yinline-handlers test/inliner-bug.scala
java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
Main$.body()V @77: invokespecial
Reason:
Type top (current frame, stack[1]) is not assignable to reference type
Current Frame:
bci: @77
flags: { }
locals: { 'Main$', 'java/lang/Throwable', 'Main$$anonfun$body$1', 'scala/None$' }
stack: { top, top, 'java/lang/Class' }
Bytecode:
0000000: 2a3a 07b2 0012 4cbb 0016 59b2 001b bb00
0000010: 1d59 b700 1e4d 4e2d b600 2499 001e a700
0000020: 224c bb00 1659 b200 1bbb 001d 59b7 001e
0000030: 4d4e 2db6 0024 9a00 0a2d b600 28a7 000d
0000040: 2c3a 0519 053a 08b2 002a b600 2eb7 0031
0000050: 572b bf
Exception Handler Table:
bci [0, 7] => handler: 33
Stackmap Table:
same_locals_1_stack_item_frame(@33,Object[#51])
full_frame(@57,{Object[#2],Object[#51],Object[#29],Object[#24]},{Top,Top})
full_frame(@64,{Object[#2],Object[#51],Object[#29],Object[#24]},{Top,Top})
full_frame(@74,{Object[#2],Object[#51],Object[#29],Object[#24]},{Top,Top,Object[#4]})

at Main.main(inliner-bug.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method){noformat}
@scabug
Copy link
Author

scabug commented Jun 19, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7589?orig=1
Reporter: @retronym
Assignee: @JamesIry
Affected Versions: 2.10.0, 2.11.0-M3

@scabug
Copy link
Author

scabug commented Jun 19, 2013

@retronym said:
This is another one distilled from Akka.

@scabug
Copy link
Author

scabug commented Jun 19, 2013

@magarciaEPFL said:
The example works fine with the new optimizer, http://magarciaepfl.github.io/scala/ , at all optimization levels. BTW no equivalent of -Yinline-handlers is supported by the new optimizer. That's on purpose. No performance gain results from -Yinline-handlers .

@scabug scabug added this to the Backlog milestone Apr 7, 2017
@SethTisue
Copy link
Member

seems fixed in 2.12

@SethTisue SethTisue modified the milestones: Backlog, 2.12.0 Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants