From 5b8a77398608689088938454583d284afd58ab50 Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Tue, 15 Nov 2016 17:54:09 +0100 Subject: codegen: cleanup value types before storing them --- libsolidity/codegen/LValue.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libsolidity/codegen/LValue.cpp') diff --git a/libsolidity/codegen/LValue.cpp b/libsolidity/codegen/LValue.cpp index 3f1730d1..933c0419 100644 --- a/libsolidity/codegen/LValue.cpp +++ b/libsolidity/codegen/LValue.cpp @@ -221,6 +221,11 @@ void StorageItem::storeValue(Type const& _sourceType, SourceLocation const& _loc { solAssert(m_dataType->storageBytes() <= 32, "Invalid storage bytes size."); solAssert(m_dataType->storageBytes() > 0, "Invalid storage bytes size."); + + m_context << Instruction::SWAP2; + CompilerUtils(m_context).convertType(*m_dataType, *m_dataType, true); + m_context << Instruction::SWAP2; + if (m_dataType->storageBytes() == 32) { solAssert(m_dataType->sizeOnStack() == 1, "Invalid stack size."); -- cgit