mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix problem with release version string.
This commit is contained in:
parent
c1b39b8538
commit
6a55405160
@ -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, "");
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user