mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix tests.
This commit is contained in:
parent
aa1fd6a879
commit
1e35526eb6
@ -525,6 +525,7 @@ LinkerObject const& Assembly::assemble() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_subs.empty() || !m_data.empty() || !m_auxiliaryData.empty())
|
||||||
// Append a STOP just to be sure.
|
// Append a STOP just to be sure.
|
||||||
ret.bytecode.push_back(0);
|
ret.bytecode.push_back(0);
|
||||||
|
|
||||||
|
@ -220,13 +220,6 @@ void CompilerContext::appendInlineAssembly(
|
|||||||
solAssert(assembly::InlineAssemblyStack().parseAndAssemble(*assembly, *m_asm, identifierAccess), "");
|
solAssert(assembly::InlineAssemblyStack().parseAndAssemble(*assembly, *m_asm, identifierAccess), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilerContext::injectVersionStampIntoSub(size_t _subIndex)
|
|
||||||
{
|
|
||||||
eth::Assembly& sub = m_asm->sub(_subIndex);
|
|
||||||
sub.injectStart(Instruction::POP);
|
|
||||||
sub.injectStart(fromBigEndian<u256>(binaryVersion()));
|
|
||||||
}
|
|
||||||
|
|
||||||
FunctionDefinition const& CompilerContext::resolveVirtualFunction(
|
FunctionDefinition const& CompilerContext::resolveVirtualFunction(
|
||||||
FunctionDefinition const& _function,
|
FunctionDefinition const& _function,
|
||||||
vector<ContractDefinition const*>::const_iterator _searchStart
|
vector<ContractDefinition const*>::const_iterator _searchStart
|
||||||
|
@ -152,9 +152,6 @@ public:
|
|||||||
std::map<std::string, std::string> const& _replacements = std::map<std::string, std::string>{}
|
std::map<std::string, std::string> const& _replacements = std::map<std::string, std::string>{}
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Prepends "PUSH <compiler version number> POP"
|
|
||||||
void injectVersionStampIntoSub(size_t _subIndex);
|
|
||||||
|
|
||||||
/// Appends arbitrary data to the end of the bytecode.
|
/// Appends arbitrary data to the end of the bytecode.
|
||||||
void appendAuxiliaryData(bytes const& _data) { m_asm->appendAuxiliaryDataToEnd(_data); }
|
void appendAuxiliaryData(bytes const& _data) { m_asm->appendAuxiliaryDataToEnd(_data); }
|
||||||
|
|
||||||
|
@ -6547,17 +6547,6 @@ BOOST_AUTO_TEST_CASE(calldata_offset)
|
|||||||
BOOST_CHECK(callContractFunction("last()", encodeArgs()) == encodeDyn(string("nd")));
|
BOOST_CHECK(callContractFunction("last()", encodeArgs()) == encodeDyn(string("nd")));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(version_stamp_for_libraries)
|
|
||||||
{
|
|
||||||
char const* sourceCode = "library lib {}";
|
|
||||||
m_optimize = true;
|
|
||||||
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], 4); // might change once we switch away from x.4.x
|
|
||||||
BOOST_CHECK_EQUAL(runtimeCode[7], int(Instruction::POP));
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(contract_binary_dependencies)
|
BOOST_AUTO_TEST_CASE(contract_binary_dependencies)
|
||||||
{
|
{
|
||||||
char const* sourceCode = R"(
|
char const* sourceCode = R"(
|
||||||
|
Loading…
Reference in New Issue
Block a user