compiler: Fix emitting big uint64 constants
Currently we take int64 value from the Go parser and push it to the stack. Using uint64 is not a common practice (usually we just use `int`), but can be a problem while doing bit arithmetic and serializing numbers. Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
This commit is contained in:
parent
91c928e8d3
commit
96ee2e2b2d
2 changed files with 13 additions and 1 deletions
|
@ -18,6 +18,14 @@ var numericTestCases = []testCase{
|
|||
`,
|
||||
big.NewInt(6),
|
||||
},
|
||||
{
|
||||
"shift uint64",
|
||||
`package foo
|
||||
func Main() uint64 {
|
||||
return 1 << 63
|
||||
}`,
|
||||
new(big.Int).SetUint64(1 << 63),
|
||||
},
|
||||
}
|
||||
|
||||
func TestNumericExprs(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue