diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-03-15 19:12:41 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-03-15 21:06:27 +0800 |
commit | 07045d492fa3ab52b1f04db795c75bb27cbc6cb5 (patch) | |
tree | e7ca20b835620ecf15a411540af4fb0cdb26067a /libsolidity/ast | |
parent | dfc8f890bf706d844e5af3b8ca10268ce630bdd7 (diff) | |
download | dexon-solidity-07045d492fa3ab52b1f04db795c75bb27cbc6cb5.tar.gz dexon-solidity-07045d492fa3ab52b1f04db795c75bb27cbc6cb5.tar.zst dexon-solidity-07045d492fa3ab52b1f04db795c75bb27cbc6cb5.zip |
Do not try parsing hex numbers as scientific notation
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/Types.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index f1b47ebe..6234a04d 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -32,6 +32,7 @@ #include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string/replace.hpp> +#include <boost/algorithm/string/predicate.hpp> #include <boost/range/adaptor/reversed.hpp> #include <boost/range/adaptor/sliced.hpp> #include <boost/range/adaptor/transformed.hpp> @@ -581,7 +582,7 @@ 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 (expPoint != _literal.value().end()) + if (!boost::starts_with(_literal.value(), "0x") && (expPoint != _literal.value().end())) { if ( !all_of(_literal.value().begin(), expPoint, ::isdigit) |