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
invalid bytecode when using range inside the map function of an Option #6720
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6720?orig=1 |
Alois Cochard (aloiscochard) said: |
@paulp said: |
Alois Cochard (aloiscochard) said: FYI, I just tried with RC3 and the bug is still there. |
@paulp said: Interestingly the bytecode generated under -target:jvm-1.6 and -target:jvm-1.7 is bit-for-bit identical except for the minor version number under 1.7 being 51. This suggests the vm in java7 is being less forgiving about something we were getting away with in the past. |
@magarciaEPFL said: |
@magarciaEPFL said:
|
@magarciaEPFL said (edited on Dec 1, 2012 2:52:17 PM UTC):
|
@magarciaEPFL said:
Error message:
Output produced by ASM's
Verbose output by
|
@magarciaEPFL said:
The first constraint applies in our case, and in fact appears the bytecode should be accepted. There's been recent work on HotSpot to make VerifyErrors more informative, perhaps an unintended result of that work was checking a more stringent condition than required by the spec.
|
@magarciaEPFL said:
|
@magarciaEPFL said: The Oracle JVM as of JDK 7 has started rejecting bytecode of the form: NEW x
DUP
... instructions loading ctor-args, involving a backedge
INVOKESPECIAL <init> The above can be detected bytecode-level, and solved bytecode-level by reformulating into: ... instructions loading ctor-args, involving a backedge
STORE nth-arg
...
STORE 1st-arg
NEW x
DUP
LOAD 1st-arg
...
LOAD nth-arg
INVOKESPECIAL <init> After rewriting To implement the above, an ASM utility computing usage-definition and definition-usage webs is needed. That's already available for the experimental optimizer I've been working on (that utility is called private def avoidBackedgesInConstructorArgs(cnode: ClassNode) { |
@magarciaEPFL said: |
@magarciaEPFL said:
I can't reproduce anymore. |
When the following function is called:
It result in this runtime exception:
java.lang.VerifyError: Uninitialized object exists on backward branch 92 in method com.timeout.service.test.ScalaBug$.bug()Lscala/Option; at offset 114
The text was updated successfully, but these errors were encountered: