ARudik / phc

Automatically exported from code.google.com/p/phc
0 stars 0 forks source link

source-vs-semantic errors #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On my Athlon 64, running 32-bit Linux, I'm still getting two
source-vs-semantic errors

edsko@slash:~/phc/trunk$ cat
test/logs/source_vs_semantic_values/bugs/bug0009.php.log
Command (0): src/phc --run plugins/tests/source_vs_semantic_values.la
test/subjects/bugs/bug0009.php 2>&1 | /opt/php/bin/php -C -d
memory_limit=25M 2>&1
Failure (Token_int): '2147483647' (integer: 2147483647) vs '0x100000000'
(double: 4294967296))
Failure

Command (0): src/phc --run plugins/tests/source_vs_semantic_values.la
test/subjects/bugs/bug0011.php 2>&1 | /opt/php/bin/php -C -d
memory_limit=25M 2>&1
Failure (Token_int): '2147483647' (integer: 2147483647) vs '0x100000000'
(double: 4294967296))
Failure (Token_int): '2147483647' (integer: 2147483647) vs '0x100000001'
(double: 4294967297))
Failure (Token_int): '2147483647' (integer: 2147483647) vs '0x100000002'
(double: 4294967298))
Failure (Token_int): '-2147483647' (integer: -2147483647) vs '-0x100000000'
(double: -4294967296))
Failure (Token_int): '-2147483647' (integer: -2147483647) vs '-0x100000001'
(double: -4294967297))
Failure (Token_int): '-2147483647' (integer: -2147483647) vs '-0x100000002'
(double: -4294967298))
Failure

Original issue reported on code.google.com by edskodev...@gmail.com on 14 Apr 2007 at 4:11

GoogleCodeExporter commented 9 years ago
Ok, turns out this is due to a change in the PHP api:

edsko@slash:~$ /opt/php-5.2.0/bin/php -r "var_dump(0x100000000);"
int(2147483647)
edsko@slash:~$ /opt/php-5.2.1/bin/php -r "var_dump(0x100000000);"
float(4294967296)

Now we need to make a policy decision...

Original comment by edskodev...@gmail.com on 14 Apr 2007 at 5:26

GoogleCodeExporter commented 9 years ago
The decision was to change to the 5.2.1 behaviour, since it is cleaner. 

Bug 16 discusses a longer term fix for this sort of problem.

Original comment by paul.biggar on 14 Apr 2007 at 5:47

GoogleCodeExporter commented 9 years ago
I removed the strange edge cases for hexadecimal ints, which have mercifully 
been
fixed to work in an intuitive way in PHP 5.2.1.

Original comment by paul.biggar on 14 Apr 2007 at 7:53