aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface/Version.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/interface/Version.cpp')
-rw-r--r--libsolidity/interface/Version.cpp5
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;