hscript
hscript copied to clipboard
[php, python] big int issue
the following test in Test.hx failed when targeting php and python:
assertScript("0xBFFFFFFF", 0xBFFFFFFF);
The same error is returned by php and python:
ERR: Test.hx:16(Test.assertScript) - expected '-1073741825' but was '3221225471'
It comes from there https://github.com/HaxeFoundation/hscript/blob/master/hscript/Parser.hx#L980-L989, any idea how to fix this @Simn ?
Does it work if the Haxe 2 version with Int32 is used?
I'm not sure, we didn't unit test it on PHP/Python at this time I think
Just tested, it parses the correct value when using Int32, but with CInt
taking an Int argument that doesn't help much. Even when changing that to Int32 it doesn't make it through the interpreter though, presumably because expr
just assigns it to Dynamic when returning.
Maybe doing & 0xFFFFFFFF on these platforms would work ?