mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow magic variables in inline assembly
This commit is contained in:
parent
3bcf0909af
commit
9616470f67
@ -12,6 +12,9 @@ Bugfixes:
|
|||||||
* Code Generator: expect zero stack increase after `super` as an expression
|
* Code Generator: expect zero stack increase after `super` as an expression
|
||||||
* Inline assembly: support the `address` opcode
|
* Inline assembly: support the `address` opcode
|
||||||
* Inline assembly: fix parsing of assignment after a label.
|
* Inline assembly: fix parsing of assignment after a label.
|
||||||
|
* Inline assembly: external variables of unsupported type (such as `this`, `super`, etc.)
|
||||||
|
are properly detected. They are not available in inline assembly and can be used as
|
||||||
|
local variable names.
|
||||||
|
|
||||||
### 0.4.2 (2016-09-17)
|
### 0.4.2 (2016-09-17)
|
||||||
|
|
||||||
|
@ -592,6 +592,10 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
|
|||||||
unsigned pushes = 0;
|
unsigned pushes = 0;
|
||||||
if (dynamic_cast<FunctionDefinition const*>(declaration))
|
if (dynamic_cast<FunctionDefinition const*>(declaration))
|
||||||
pushes = 1;
|
pushes = 1;
|
||||||
|
else if (dynamic_cast<MagicVariableDeclaration const*>(declaration))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else if (auto var = dynamic_cast<VariableDeclaration const*>(declaration))
|
else if (auto var = dynamic_cast<VariableDeclaration const*>(declaration))
|
||||||
{
|
{
|
||||||
if (var->isConstant())
|
if (var->isConstant())
|
||||||
|
Loading…
Reference in New Issue
Block a user