diff options
author | chriseth <c@ethdev.com> | 2016-09-08 23:56:28 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-09-08 23:56:28 +0800 |
commit | 6a55405160475fa6166df4888c8d821b4105f879 (patch) | |
tree | f0a47a3e3f8276f4b59e03f2ca31a421eb43d3e4 | |
parent | c1b39b8538fc86573f853e9ff1035df9155d61bd (diff) | |
download | dexon-solidity-6a55405160475fa6166df4888c8d821b4105f879.tar.gz dexon-solidity-6a55405160475fa6166df4888c8d821b4105f879.tar.zst dexon-solidity-6a55405160475fa6166df4888c8d821b4105f879.zip |
Fix problem with release version string.
-rw-r--r-- | libsolidity/interface/Version.cpp | 8 | ||||
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/libsolidity/interface/Version.cpp b/libsolidity/interface/Version.cpp index 31ba4afc..0dca1ced 100644 --- a/libsolidity/interface/Version.cpp +++ b/libsolidity/interface/Version.cpp @@ -58,12 +58,14 @@ bytes dev::solidity::binaryVersion() solAssert(i < VersionString.size() && VersionString[i] == '.', ""); ++i; ret.push_back(byte(parseDecimal())); - solAssert(i < VersionString.size() && VersionString[i] == '-', ""); + solAssert(i < VersionString.size() && (VersionString[i] == '-' || VersionString[i] == '+'), ""); ++i; + size_t commitpos = VersionString.find("commit."); + solAssert(commitpos != string::npos, ""); + i = commitpos + 7; solAssert(i + 7 < VersionString.size(), ""); bytes commitHash = fromHex(VersionString.substr(i, 8)); - if (commitHash.empty()) - commitHash = bytes(4, 0); + solAssert(!commitHash.empty(), ""); ret += commitHash; solAssert(ret.size() == 1 + 3 + 4, ""); diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 3c85d8a8..7ee5700c 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -5961,7 +5961,7 @@ BOOST_AUTO_TEST_CASE(version_stamp_for_libraries) bytes runtimeCode = compileAndRun(sourceCode, 0, "lib"); BOOST_CHECK(runtimeCode.size() >= 8); BOOST_CHECK_EQUAL(runtimeCode[0], int(Instruction::PUSH6)); // might change once we switch to 1.x.x - BOOST_CHECK_EQUAL(runtimeCode[1], 3); // might change once we switch away from x.3.x + BOOST_CHECK_EQUAL(runtimeCode[1], 4); // might change once we switch away from x.4.x BOOST_CHECK_EQUAL(runtimeCode[7], int(Instruction::POP)); } |