mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1182 from ethereum/inline-assembly-magic-variables
Disallow magic variables in inline assembly
This commit is contained in:
commit
2bb37f8203
14
Changelog.md
14
Changelog.md
@ -2,16 +2,18 @@
|
||||
|
||||
Features:
|
||||
|
||||
* Inline assembly: support both `sucide` and `selfdestruct` opcodes
|
||||
(note: `suicide` is deprecated)
|
||||
* Include `keccak256()` as an alias to `sha3()`
|
||||
* Inline assembly: support both ``suicide`` and ``selfdestruct`` opcodes
|
||||
(note: ``suicide`` is deprecated).
|
||||
* Include ``keccak256()`` as an alias to ``sha3()``.
|
||||
|
||||
Bugfixes:
|
||||
* Disallow unknown options in `solc`
|
||||
* Disallow unknown options in ``solc``.
|
||||
* Proper type checking for bound functions.
|
||||
* Code Generator: expect zero stack increase after `super` as an expression
|
||||
* Inline assembly: support the `address` opcode
|
||||
* 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.
|
||||
* Inline assembly: external variables of unsupported type (such as ``this``, ``super``, etc.)
|
||||
are properly detected as unusable.
|
||||
|
||||
### 0.4.2 (2016-09-17)
|
||||
|
||||
|
@ -609,6 +609,8 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
|
||||
return false;
|
||||
pushes = 1;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
for (unsigned i = 0; i < pushes; ++i)
|
||||
_assembly.append(u256(0)); // just to verify the stack height
|
||||
}
|
||||
|
@ -162,6 +162,13 @@ BOOST_AUTO_TEST_CASE(assignment_after_tag)
|
||||
BOOST_CHECK(successParse("{ let x := 1 { tag: =: x } }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(magic_variables)
|
||||
{
|
||||
BOOST_CHECK(!successAssemble("{ this }"));
|
||||
BOOST_CHECK(!successAssemble("{ ecrecover }"));
|
||||
BOOST_CHECK(successAssemble("{ let ecrecover := 1 ecrecover }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user