mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1244 from ethereum/1242
`super`'s size on stack is zero
This commit is contained in:
commit
65da8e4e16
@ -8,6 +8,7 @@ Features:
|
||||
|
||||
Bugfixes:
|
||||
* Disallow unknown options in `solc`
|
||||
* Code Generator: expect zero stack increase after `super` as an expression
|
||||
* Inline assembly: support the `address` opcode
|
||||
* Inline assembly: fix parsing of assignment after a label.
|
||||
|
||||
|
@ -623,6 +623,7 @@ public:
|
||||
}
|
||||
virtual unsigned storageBytes() const override { return 20; }
|
||||
virtual bool canLiveOutsideStorage() const override { return true; }
|
||||
virtual unsigned sizeOnStack() const override { return m_super ? 0 : 1; }
|
||||
virtual bool isValueType() const override { return true; }
|
||||
virtual std::string toString(bool _short) const override;
|
||||
virtual std::string canonicalName(bool _addDataLocation) const override;
|
||||
|
@ -2513,6 +2513,15 @@ BOOST_AUTO_TEST_CASE(super_in_constructor)
|
||||
BOOST_CHECK(callContractFunction("f()") == encodeArgs(1 | 2 | 4 | 8));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(super_alone)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract A { function f() { super; } }
|
||||
)";
|
||||
compileAndRun(sourceCode, 0, "A");
|
||||
BOOST_CHECK(callContractFunction("f()") == encodeArgs());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(fallback_function)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
|
Loading…
Reference in New Issue
Block a user