Version
110.99.7.1 (Latest)
Operating System
OS Version
Ubuntu on Windows 11 WSL
Processor
System Component
Basis Library
Severity
Minor
Description
Word.toInt produces values outside the range [0,2^(wordSize-1))
Transcript
- Word.toInt ~1;
val it = 0wx7FFFFFFFFFFFFFFF : word
- Word.fromInt ~1 = 0wx7FFFFFFFFFFFFFFF;
val it = false : bool
Expected Behavior
- Word.toInt ~1;
val it = 0wx7FFFFFFFFFFFFFFF : word
- Word.fromInt ~1 = 0wx7FFFFFFFFFFFFFFF;
val it = true : bool
Steps to Reproduce
Type the above code
Additional Information
I believe this is an issue in conversion: (W63)9223372036854775807 is converted to (I63t)9223372036854775807 when it should be converted to (I63t)~1.
[After fcontract+eta ...]
v5{1} : (FCT) =
FN([v11{0} : ???],
v1{2} = PRIMOP(copy_63_63, <I63> -f-> <I63>, []) [(I63)~1]
[v3{1}] = IF PRIMOP(=u63, <I63,I63> -f-> <VOID>, []) [v1,(W63)9223372036854775807]
THEN
v8{1} = WRAP(I63, (I63)1)
RETURN [v8]
ELSE
v10{1} = WRAP(I63, (I63)0)
RETURN [v10]
v6{1} = STRUCT [v3,v1,(W63)9223372036854775807]
RETURN [v6])
[After convert ...]
std v5(v13[C],v11[PR0]) =
v17(v18[PV]) =
v17("bogus")
v12(v19[PV]) =
v17("bogus")
copy_63_63((I63t)~1) -> v1[I]
v15(v14[PV]) =
{v14,v1,(I63t)9223372036854775807} -> v6
v13(v6)
if u63=(v1,(I63t)9223372036854775807) [v16] then
wrap_i63((I63t)1) -> v8[PV]
v15(v8)
else
wrap_i63((I63t)0) -> v10[PV]
v15(v10)
Email address
ssoss AT uchicago DOT edu
Version
110.99.7.1 (Latest)
Operating System
OS Version
Ubuntu on Windows 11 WSL
Processor
System Component
Basis Library
Severity
Minor
Description
Word.toIntproduces values outside the range [0,2^(wordSize-1))Transcript
Expected Behavior
Steps to Reproduce
Type the above code
Additional Information
I believe this is an issue in conversion:
(W63)9223372036854775807is converted to(I63t)9223372036854775807when it should be converted to(I63t)~1.Email address
ssoss AT uchicago DOT edu