diff options
author | VoR0220 <catalanor0220@gmail.com> | 2016-03-31 02:09:38 +0800 |
---|---|---|
committer | VoR0220 <catalanor0220@gmail.com> | 2016-03-31 02:09:38 +0800 |
commit | 9404600b3f99acb633f6400baa0b53db42a8a626 (patch) | |
tree | a13aa15578b043ab3e758a4730094b9d249c0c8f /libsolidity/parsing/Token.cpp | |
parent | 427b9557d688fe901814350099540ce333a59acd (diff) | |
download | dexon-solidity-9404600b3f99acb633f6400baa0b53db42a8a626.tar.gz dexon-solidity-9404600b3f99acb633f6400baa0b53db42a8a626.tar.zst dexon-solidity-9404600b3f99acb633f6400baa0b53db42a8a626.zip |
helper function in scanner and corresponding edits to parserBase
Diffstat (limited to 'libsolidity/parsing/Token.cpp')
-rw-r--r-- | libsolidity/parsing/Token.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/parsing/Token.cpp b/libsolidity/parsing/Token.cpp index 24877c70..097a6f54 100644 --- a/libsolidity/parsing/Token.cpp +++ b/libsolidity/parsing/Token.cpp @@ -132,6 +132,7 @@ tuple<Token::Value, unsigned int, unsigned int> Token::fromIdentifierOrKeyword(s Token::Value keyword = keywordByName(baseType); if (keyword == Token::Bytes) { + solAssert(m != -1, "Invalid type M in fixed command. Should not reach here."); if (0 < m && m <= 32 && positionX == _literal.end()) return make_tuple(Token::BytesM, m, 0); } @@ -139,6 +140,7 @@ tuple<Token::Value, unsigned int, unsigned int> Token::fromIdentifierOrKeyword(s { if (0 < m && m <= 256 && m % 8 == 0 && positionX == _literal.end()) { + solAssert(m != -1, "Invalid type M in fixed command. Should not reach here."); if (keyword == Token::UInt) return make_tuple(Token::UIntM, m, 0); else @@ -160,6 +162,7 @@ tuple<Token::Value, unsigned int, unsigned int> Token::fromIdentifierOrKeyword(s m % 8 == 0 && n % 8 == 0 ) { + solAssert(n != -1, "Invalid type N in fixed command. Should not reach here."); if (keyword == Token::UFixed) return make_tuple(Token::UFixedMxN, m, n); else |