From d18e56661d039aa79e1fcccea6986868a8f8586b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 10 Oct 2016 21:01:06 +0100 Subject: Disallow unsupported RValues in inline assembly --- libsolidity/analysis/TypeChecker.cpp | 6 ++---- 1 file 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(declaration)) pushes = 1; - else if (dynamic_cast(declaration)) - { - return false; - } else if (auto var = dynamic_cast(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 } -- cgit