Kray-G / kinx

Looks like JavaScript, feels like Ruby, and it is a script language fitting in C programmers.
MIT License
240 stars 7 forks source link

Compiling incorrect for Big integer. #331

Closed Kray-G closed 3 years ago

Kray-G commented 3 years ago
var n = 9223372036854775811;    // Big Integer.
System.println(n.toString());
System.println(9223372036854775811.toString());

It is no problem when it's an assignment. But at the last line, the compiled value is incorrect.

  .L3026
      12:   pushb                   9223372036854775811 (10)
      13:   storev                  $0(70)
      14:   calls                   "toString", 0
      15:   pushvl0                 $0(8)
      16:   calls                   "println", 1
      17:   pop
      18:   pushi                   9223372036854775807
      19:   calls                   "toString", 0
      1a:   pushvl0                 $0(8)
      1b:   calls                   "println", 1
      1c:   pop