aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-10-11 04:01:06 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-10-20 03:44:15 +0800
commitd18e56661d039aa79e1fcccea6986868a8f8586b (patch)
tree62eec8f5d156760dbca7ca107cd33c381c57c791 /libsolidity
parent0a3faf48d472a6f0e49f56ac9d547ce8073f40fd (diff)
downloaddexon-solidity-d18e56661d039aa79e1fcccea6986868a8f8586b.tar.gz
dexon-solidity-d18e56661d039aa79e1fcccea6986868a8f8586b.tar.zst
dexon-solidity-d18e56661d039aa79e1fcccea6986868a8f8586b.zip
Disallow unsupported RValues in inline assembly
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index b9b182c0..332ce2c3 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -592,10 +592,6 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
unsigned pushes = 0;
if (dynamic_cast<FunctionDefinition const*>(declaration))
pushes = 1;
- else if (dynamic_cast<MagicVariableDeclaration const*>(declaration))
- {
- return false;
- }
else if (auto var = dynamic_cast<VariableDeclaration const*>(declaration))
{
if (var->isConstant())
@@ -613,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
}