mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow radix points in hex literals
This commit is contained in:
parent
07045d492f
commit
a2b9f52ca4
@ -582,7 +582,12 @@ tuple<bool, rational> RationalNumberType::isValidLiteral(Literal const& _literal
|
|||||||
expPoint = find(_literal.value().begin(), _literal.value().end(), 'E');
|
expPoint = find(_literal.value().begin(), _literal.value().end(), 'E');
|
||||||
auto radixPoint = find(_literal.value().begin(), _literal.value().end(), '.');
|
auto radixPoint = find(_literal.value().begin(), _literal.value().end(), '.');
|
||||||
|
|
||||||
if (!boost::starts_with(_literal.value(), "0x") && (expPoint != _literal.value().end()))
|
if (boost::starts_with(_literal.value(), "0x"))
|
||||||
|
{
|
||||||
|
// process as hex
|
||||||
|
x = bigint(_literal.value());
|
||||||
|
}
|
||||||
|
else if (expPoint != _literal.value().end())
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
!all_of(_literal.value().begin(), expPoint, ::isdigit)
|
!all_of(_literal.value().begin(), expPoint, ::isdigit)
|
||||||
|
Loading…
Reference in New Issue
Block a user