optimizer changes behavior of IDIV, LDIV, IREM, LREM bytecode instructions when the result is dropped #7607
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7607?orig=1 |
@magarciaEPFL said: (the new optimizer isn't prone to this bug) |
@lrytz said: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When compiled with
-optimize
the following program goes wrong:It swallows the
ArithmeticException
that the JVMS specifies should be thrown. The bytecode emitted is:The problem goes away when the body of
main
is changed to use the result of(1 / 0)
(as opposed to discarding the result as above). For example-optimize
emits correct bytecode for:Originally reported in https://groups.google.com/forum/#!searchin/akka-user/optimize/akka-user/r0Teq08f-YU/2Dfl1yQKbL0J
The text was updated successfully, but these errors were encountered: