mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #426 from chriseth/optfix
Test for optimizer bug caused by not incrementing the sequence counter.
This commit is contained in:
commit
172beaec5e
@ -390,6 +390,20 @@ BOOST_AUTO_TEST_CASE(incorrect_storage_access_bug)
|
||||
compareVersions("f()");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(sequence_number_for_calls)
|
||||
{
|
||||
// This is a test for a bug that was present because we did not increment the sequence
|
||||
// number for CALLs - CALLs can read and write from memory (and DELEGATECALLs can do the same
|
||||
// to storage), so the sequence number should be incremented.
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
function f(string a, string b) returns (bool) { return sha256(a) == sha256(b); }
|
||||
}
|
||||
)";
|
||||
compileBothVersions(sourceCode);
|
||||
compareVersions("f(string,string)", 0x40, 0x80, 3, "abc", 3, "def");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(cse_intermediate_swap)
|
||||
{
|
||||
eth::KnownState state;
|
||||
|
Loading…
Reference in New Issue
Block a user