From 907cf28f49f785ad8b53a8d5a36f2c47145d9f8a Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 2 Nov 2015 18:02:51 +0100 Subject: Fix: Cope with non-existing commit hash. --- libsolidity/interface/Version.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libsolidity/interface') 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; -- cgit v1.2.3