Fix floating-point overflow for binary, octal, and hex literals.
commit8b0aebf6ed9c86b9034b424ecb423620f199ace6
authorAlex Malyshev <alexanderm@fb.com>
Fri, 27 Jun 2014 22:08:52 +0000 (27 15:08 -0700)
committerfacebook-github-bot <githubbot@fb.com>
Tue, 1 Jul 2014 04:06:58 +0000 (30 21:06 -0700)
tree834dd645eae7416c248adf975cecb2e5ed0dc622
parent7f710ab1c1d48c75256b60571c5dd69388c9d30d
Fix floating-point overflow for binary, octal, and hex literals.

Summary: Literals that are hex, oct, or binary are promoted to doubles when
they set the sign bit. We were using strtoull instead of strtoll.

We also weren't calling zend_oct_strtod or zend_bin_strtod (we didn't
even have it, I pulled it in from php-src) in
ScalarExpression::getVariant().

Reviewed By: @ptarjan

Differential Revision: D1409285
hphp/compiler/expression/scalar_expression.cpp
hphp/parser/hphp.ll
hphp/parser/lex.yy.cpp
hphp/runtime/base/zend-strtod.cpp
hphp/runtime/base/zend-strtod.h
hphp/test/quick/float-overflow-literals.php [new file with mode: 0644]
hphp/test/quick/float-overflow-literals.php.expect [new file with mode: 0644]
hphp/test/quick/float-overflow-literals.php.hphp_opts [new file with mode: 0644]
hphp/test/quick/float-overflow-literals.php.opts [new file with mode: 0644]