solAsserts added and some changes rolled back.

This commit is contained in:
VoR0220 2016-03-30 13:15:54 -05:00
parent 9404600b3f
commit 1b39d3b5d4
2 changed files with 3 additions and 2 deletions

View File

@ -113,7 +113,7 @@ int Token::parseSize(string::const_iterator _begin, string::const_iterator _end)
{ {
try try
{ {
unsigned int m = boost::lexical_cast<unsigned int>(boost::make_iterator_range(_begin, _end)); unsigned int m = boost::lexical_cast<int>(boost::make_iterator_range(_begin, _end));
return m; return m;
} }
catch(boost::bad_lexical_cast const&) catch(boost::bad_lexical_cast const&)

View File

@ -334,7 +334,8 @@ public:
std::string name = Token::toString(m_token); std::string name = Token::toString(m_token);
if (tokenValue || (firstNumber() == 0 && secondNumber() == 0)) if (tokenValue || (firstNumber() == 0 && secondNumber() == 0))
return name; 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); return name.substr(0, name.size() - 3) + std::to_string(m_firstNumber) + "x" + std::to_string(m_secondNumber);
else else
return name.substr(0, name.size() - 1) + std::to_string(m_firstNumber); return name.substr(0, name.size() - 1) + std::to_string(m_firstNumber);