diff options
author | chriseth <c@ethdev.com> | 2015-11-03 01:38:09 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-11-03 01:38:09 +0800 |
commit | 665344eeb2caf7d9da5e5979f5f1983ecdcd9327 (patch) | |
tree | 8c2ba6efe9c04800706dad83dd627302fff9bd26 | |
parent | 5981ee4013c0409a37fb29dbcfaa23f8f95c4a54 (diff) | |
parent | 907cf28f49f785ad8b53a8d5a36f2c47145d9f8a (diff) | |
download | dexon-solidity-665344eeb2caf7d9da5e5979f5f1983ecdcd9327.tar.gz dexon-solidity-665344eeb2caf7d9da5e5979f5f1983ecdcd9327.tar.zst dexon-solidity-665344eeb2caf7d9da5e5979f5f1983ecdcd9327.zip |
Merge pull request #188 from chriseth/fix_copeWithNonExistingCommitHash
Fix: Cope with non-existing commit hash.
-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; |