mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Resolve binary dependencies properly.
This commit is contained in:
@@ -5555,16 +5555,16 @@ BOOST_AUTO_TEST_CASE(calldata_offset)
|
||||
// This tests a specific bug that was caused by not using the correct memory offset in the
|
||||
// calldata unpacker.
|
||||
char const* sourceCode = R"(
|
||||
contract CB
|
||||
contract CB
|
||||
{
|
||||
address[] _arr;
|
||||
string public last = "nd";
|
||||
function CB(address[] guardians)
|
||||
{
|
||||
address[] _arr;
|
||||
string public last = "nd";
|
||||
function CB(address[] guardians)
|
||||
{
|
||||
_arr = guardians;
|
||||
}
|
||||
_arr = guardians;
|
||||
}
|
||||
)";
|
||||
}
|
||||
)";
|
||||
compileAndRun(sourceCode, 0, "CB", encodeArgs(u256(0x20)));
|
||||
BOOST_CHECK(callContractFunction("last()", encodeArgs()) == encodeDyn(string("nd")));
|
||||
}
|
||||
@@ -5580,6 +5580,16 @@ BOOST_AUTO_TEST_CASE(version_stamp_for_libraries)
|
||||
BOOST_CHECK_EQUAL(runtimeCode[7], int(eth::Instruction::POP));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(contract_binary_dependencies)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract A { function f() { new B(); } }
|
||||
contract B { function f() { } }
|
||||
contract C { function f() { new B(); } }
|
||||
)";
|
||||
compileAndRun(sourceCode);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(reject_ether_sent_to_library)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
|
||||
Reference in New Issue
Block a user