Browse Source

style fixes

cl-refactor
Liana Husikyan 10 years ago
parent
commit
c17c9a4c31
  1. 16
      libevmcore/Assembly.cpp

16
libevmcore/Assembly.cpp

@ -182,16 +182,16 @@ string Assembly::getLocationFromSources(StringMap const& _sourceCodes, SourceLoc
if (it == _sourceCodes.end()) if (it == _sourceCodes.end())
return ""; return "";
string toReturn = it->second; string const& source = it->second;
if (_location.start >= (int)toReturn.size()) if (size_t(_location.start) >= source.size())
return ""; return "";
toReturn = toReturn.substr(_location.start, _location.end - _location.start); string cut = source.substr(_location.start, _location.end - _location.start);
auto newLinePos = toReturn.find_first_of("\n"); auto newLinePos = cut.find_first_of("\n");
if (newLinePos != string::npos && newLinePos != toReturn.size() - 1) if (newLinePos != string::npos)
toReturn = toReturn.substr(0, newLinePos) + "..."; cut = cut.substr(0, newLinePos) + "...";
return move(toReturn); return move(cut);
} }
ostream& Assembly::streamRLP(ostream& _out, string const& _prefix, StringMap const& _sourceCodes) const ostream& Assembly::streamRLP(ostream& _out, string const& _prefix, StringMap const& _sourceCodes) const
@ -239,7 +239,7 @@ ostream& Assembly::streamRLP(ostream& _out, string const& _prefix, StringMap con
default: default:
BOOST_THROW_EXCEPTION(InvalidOpcode()); BOOST_THROW_EXCEPTION(InvalidOpcode());
} }
_out << string(20, ' ') << sourceLine << endl; _out << string("\t\t") << sourceLine << endl;
} }
if (!m_data.empty() || !m_subs.empty()) if (!m_data.empty() || !m_subs.empty())

Loading…
Cancel
Save