diff options
author | chriseth <c@ethdev.com> | 2015-11-03 01:02:51 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-11-03 01:03:04 +0800 |
commit | 907cf28f49f785ad8b53a8d5a36f2c47145d9f8a (patch) | |
tree | 8c2ba6efe9c04800706dad83dd627302fff9bd26 /libsolidity/interface/Version.cpp | |
parent | 5981ee4013c0409a37fb29dbcfaa23f8f95c4a54 (diff) | |
download | dexon-solidity-907cf28f49f785ad8b53a8d5a36f2c47145d9f8a.tar.gz dexon-solidity-907cf28f49f785ad8b53a8d5a36f2c47145d9f8a.tar.zst dexon-solidity-907cf28f49f785ad8b53a8d5a36f2c47145d9f8a.zip |
Fix: Cope with non-existing commit hash.
Diffstat (limited to 'libsolidity/interface/Version.cpp')
-rw-r--r-- | libsolidity/interface/Version.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libsolidity/interface/Version.cpp b/libsolidity/interface/Version.cpp index d2a53440..84a82dbf 100644 --- a/libsolidity/interface/Version.cpp +++ b/libsolidity/interface/Version.cpp @@ -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; |