You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
newtype uint8 = x : int | 0 <= x < 256
methodMain() {
var y := 0x80 asbv8;
var x := (y >> 4) as uint8;
assert x != 248; // What Java obtainsassert x == 0x8;
if x == 248 {
var x := 1/0;
}
print "All right";
}
Dafny program verifier finished with 2 verified, 0 errors
Exception in thread "main" java.lang.ArithmeticException: BigInteger divide by z
ero
at java.base/java.math.MutableBigInteger.divideKnuth(MutableBigInteger.j
ava:1184)
at java.base/java.math.BigInteger.divideKnuth(BigInteger.java:2318)
at java.base/java.math.BigInteger.divide(BigInteger.java:2299)
at dafny.DafnyEuclidean.EuclideanDivision(DafnyEuclidean.java:90)
at _System.__default.Main(__default.java:22)
at _System.__default.__Main(__default.java:27)
at git_issu_3724bis.lambda$main$0(git_issu_3724bis.java:10)
at dafny.Helpers.withHaltHandling(Helpers.java:279)
at git_issu_3724bis.main(git_issu_3724bis.java:10
Looks like the generated Java code is the following:
Dafny version
4.0.0
Code to produce this issue
Command to run and resulting output
What happened?
This is a minimum reproductible example for #3724
Looks like the generated Java code is the following:
Transforming "4" in "3" and "0x80" in "0x40" does not trigger the stack overflow, so it's really the last byte.
What type of operating system are you experiencing the problem on?
Windows, Mac
The text was updated successfully, but these errors were encountered: