aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-03-15 19:16:44 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-03-15 21:06:27 +0800
commita2b9f52ca4a70289ba5d9892d58c61659af07d40 (patch)
treeff0d65455c3c23840faa1925b6340e006440bd66 /libsolidity/ast
parent07045d492fa3ab52b1f04db795c75bb27cbc6cb5 (diff)
downloaddexon-solidity-a2b9f52ca4a70289ba5d9892d58c61659af07d40.tar.gz
dexon-solidity-a2b9f52ca4a70289ba5d9892d58c61659af07d40.tar.zst
dexon-solidity-a2b9f52ca4a70289ba5d9892d58c61659af07d40.zip
Disallow radix points in hex literals
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/Types.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 6234a04d..52d61d13 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -582,7 +582,12 @@ tuple<bool, rational> RationalNumberType::isValidLiteral(Literal const& _literal
expPoint = find(_literal.value().begin(), _literal.value().end(), 'E');
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 (
!all_of(_literal.value().begin(), expPoint, ::isdigit)