diff options
Diffstat (limited to 'libsolidity/interface/Version.cpp')
-rw-r--r-- | libsolidity/interface/Version.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libsolidity/interface/Version.cpp b/libsolidity/interface/Version.cpp index 31ba4afc..0dca1ced 100644 --- a/libsolidity/interface/Version.cpp +++ b/libsolidity/interface/Version.cpp @@ -58,12 +58,14 @@ bytes dev::solidity::binaryVersion() solAssert(i < VersionString.size() && VersionString[i] == '.', ""); ++i; ret.push_back(byte(parseDecimal())); - solAssert(i < VersionString.size() && VersionString[i] == '-', ""); + solAssert(i < VersionString.size() && (VersionString[i] == '-' || VersionString[i] == '+'), ""); ++i; + size_t commitpos = VersionString.find("commit."); + solAssert(commitpos != string::npos, ""); + i = commitpos + 7; solAssert(i + 7 < VersionString.size(), ""); bytes commitHash = fromHex(VersionString.substr(i, 8)); - if (commitHash.empty()) - commitHash = bytes(4, 0); + solAssert(!commitHash.empty(), ""); ret += commitHash; solAssert(ret.size() == 1 + 3 + 4, ""); |