From c0961664f9666e5f4e8e35e80ef9a71426f6c394 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 16 Feb 2017 19:21:33 +0100 Subject: [PATCH] Deposit one stack item for non-value types in inline assembly type checking. --- Changelog.md | 1 + libsolidity/analysis/TypeChecker.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 72947dab0..45aaf04a5 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,7 @@ Bugfixes: * Commandline interface: Do not try creating paths ``.`` and ``..``. * Type system: Fix a crash caused by continuing on fatal errors in the code. * Type system: Disallow arrays with negative length. + * Inline assembly: Charge one stack slot for non-value types during analysis. ### 0.4.9 (2017-01-31) diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 28cb9acc3..4025831ea 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -611,7 +611,7 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly) fatalTypeError(SourceLocation(), "Constant variables not yet implemented for inline assembly."); if (var->isLocalVariable()) pushes = var->type()->sizeOnStack(); - else if (var->type()->isValueType()) + else if (!var->type()->isValueType()) pushes = 1; else pushes = 2; // slot number, intra slot offset