hscript icon indicating copy to clipboard operation
hscript copied to clipboard

[php, python] big int issue

Open andyli opened this issue 9 years ago • 5 comments

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'

andyli avatar Dec 07 '15 10:12 andyli

It comes from there https://github.com/HaxeFoundation/hscript/blob/master/hscript/Parser.hx#L980-L989, any idea how to fix this @Simn ?

ncannasse avatar Dec 20 '15 09:12 ncannasse

Does it work if the Haxe 2 version with Int32 is used?

Simn avatar Dec 20 '15 09:12 Simn

I'm not sure, we didn't unit test it on PHP/Python at this time I think

ncannasse avatar Dec 20 '15 09:12 ncannasse

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.

Simn avatar Dec 20 '15 10:12 Simn

Maybe doing & 0xFFFFFFFF on these platforms would work ?

ncannasse avatar Dec 20 '15 10:12 ncannasse