mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix: Cope with non-existing commit hash.
This commit is contained in:
parent
5981ee4013
commit
907cf28f49
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user