Java code generation incorrect #3724
Labels
during 4: bad execution of correct program
A bug in the Dafny compiler that causes a correct Dafny program to execute incorrectly
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
Dafny version
3.10 and 4.0
Code to produce this issue
Command to run and resulting output
What happened?
I expected both languages to pass.
Given the
ensures forall ch <- ret :: IsHex(ch)
I expected java to only produce hex characters, but instead of
00112233445566778899aabbccddeeff
java produces
0011223344556677ŏ8Ő9őaŒbœcŔdŕeŖf
In HexStr, where I have
var y := x as bv8;
var res := [HexVal((y >> 4) as uint8), HexVal((y & 0xf) as uint8)];
If I replace it with
var res := [HexVal((x / 16) as uint8), HexVal((x % 16) as uint8)];
then both languages are happy, so I'm guessing (y >> 4), with the leftmost bit set, does the "signed int" thing and extends the sign bit.
What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: