diff options
author | VoR0220 <catalanor0220@gmail.com> | 2016-03-31 02:15:54 +0800 |
---|---|---|
committer | VoR0220 <catalanor0220@gmail.com> | 2016-03-31 02:15:54 +0800 |
commit | 1b39d3b5d479aead729b765a67dfeaba0031c1ca (patch) | |
tree | da033477b8a762a827e7ccb3f133aa5c77f2dc07 /libsolidity/parsing/Token.h | |
parent | 9404600b3f99acb633f6400baa0b53db42a8a626 (diff) | |
download | dexon-solidity-1b39d3b5d479aead729b765a67dfeaba0031c1ca.tar.gz dexon-solidity-1b39d3b5d479aead729b765a67dfeaba0031c1ca.tar.zst dexon-solidity-1b39d3b5d479aead729b765a67dfeaba0031c1ca.zip |
solAsserts added and some changes rolled back.
Diffstat (limited to 'libsolidity/parsing/Token.h')
-rw-r--r-- | libsolidity/parsing/Token.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index e7a7e24c..76c274bb 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -334,7 +334,8 @@ public: std::string name = Token::toString(m_token); if (tokenValue || (firstNumber() == 0 && secondNumber() == 0)) return name; - else if (m_token == Token::FixedMxN || m_token == Token::UFixedMxN) + solAssert(name.size() >= 3, "Token name size should be greater than 3. Should not reach here."); + if (m_token == Token::FixedMxN || m_token == Token::UFixedMxN) return name.substr(0, name.size() - 3) + std::to_string(m_firstNumber) + "x" + std::to_string(m_secondNumber); else return name.substr(0, name.size() - 1) + std::to_string(m_firstNumber); |