Fix problem with release version string.

This commit is contained in:
chriseth 2016-09-08 17:56:28 +02:00
parent c1b39b8538
commit 6a55405160
2 changed files with 6 additions and 4 deletions

View File

@ -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, "");

View File

@ -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));
}