Fix: Cope with non-existing commit hash.

This commit is contained in:
chriseth 2015-11-02 18:02:51 +01:00
parent 5981ee4013
commit 907cf28f49

View File

@ -65,7 +65,10 @@ bytes dev::solidity::binaryVersion()
solAssert(i < VersionString.size() && VersionString[i] == '-', "");
++i;
solAssert(i + 7 < VersionString.size(), "");
ret += fromHex(VersionString.substr(i, 8));
bytes commitHash = fromHex(VersionString.substr(i, 8));
if (commitHash.empty())
commitHash = bytes(4, 0);
ret += commitHash;
solAssert(ret.size() == 1 + 3 + 4, "");
return ret;