mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow unsupported RValues in inline assembly
This commit is contained in:
parent
0a3faf48d4
commit
d18e56661d
@ -592,10 +592,6 @@ 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())
|
||||||
@ -613,6 +609,8 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
|
|||||||
return false;
|
return false;
|
||||||
pushes = 1;
|
pushes = 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
for (unsigned i = 0; i < pushes; ++i)
|
for (unsigned i = 0; i < pushes; ++i)
|
||||||
_assembly.append(u256(0)); // just to verify the stack height
|
_assembly.append(u256(0)); // just to verify the stack height
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user