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
Compiler generates code which crashes with VerifyError #6154
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6154?orig=1
|
@retronym said (edited on Jul 29, 2012 9:28:23 PM UTC): object Test {
def foo(a: Int) {
var bar: Int = 0
bar = try { 0 } catch { case ex: Throwable => 0 }
new { foo(bar) }
}
def main(args: Array[String]): Unit = foo(0)
}
This cut down version crashes from (at least) 2.7.7. |
@magarciaEPFL said (edited on Jul 29, 2012 9:46:17 PM UTC): To get rid of the verbose
The purpose of Resulting bytecode:
The relevant sections are:
For non-exceptional control flow, the putfield is reached with those two values, which are pushed in 17: and 18:. Those two instructions where emitted after GenICode's genStat() finds a Select in the lhs. Guessing somewhat, the "try lifting" trick in Uncurry didn't notice that a few phases later (LambdaLift) the lhs would stop being an Ident and become a Select. Thus the try expression wasn't turned into a local method. If so, not a backend problem. BTW |
@magarciaEPFL said:
None of them covers the tree for
which thus falls off to the default case, where no |
@paulp said: |
@magarciaEPFL said: |
@adriaanm said: |
@retronym said: |
@adriaanm said: |
attempt to compile and run source in attachment cause next error:
java.lang.VerifyError: (class: testverifyerror/CallCC$$anonfun$compose$1, method: apply signature: (I)Ltestverifyerror/ComputationBounds;) Inconsistent stack height 1 != 2
at testverifyerror.CallCC$.compose(Main.scala:81)
at testverifyerror.CallCC$.compose(Main.scala:111)
at testverifyerror.ComputationBounds$$anonfun$map$1.apply(Main.scala:20)
at testverifyerror.ComputationBounds$$anonfun$map$1.apply(Main.scala:20)
at scala.Function1$class.apply$mcLI$sp(Function1.scala:39)
at scala.runtime.AbstractFunction1.apply$mcLI$sp(AbstractFunction1.scala:12)
at testverifyerror.Call.step(Main.scala:39)
at testverifyerror.CallCC$.trampoline(Main.scala:67)
at testverifyerror.ComputationBounds.get(Main.scala:18)
at testverifyerror.Main$.main(Main.scala:140)
at testverifyerror.Main.main(Main.scala)
The text was updated successfully, but these errors were encountered: