aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-11-16 00:54:09 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-11-24 18:31:45 +0800
commit5b8a77398608689088938454583d284afd58ab50 (patch)
treebbb627615dad1042f69d6aa7c1990d4ac26ca4df /libsolidity
parentfeb10d015f6c8629ec24fcd2617332d67fb7f097 (diff)
downloaddexon-solidity-5b8a77398608689088938454583d284afd58ab50.tar
dexon-solidity-5b8a77398608689088938454583d284afd58ab50.tar.gz
dexon-solidity-5b8a77398608689088938454583d284afd58ab50.tar.bz2
dexon-solidity-5b8a77398608689088938454583d284afd58ab50.tar.lz
dexon-solidity-5b8a77398608689088938454583d284afd58ab50.tar.xz
dexon-solidity-5b8a77398608689088938454583d284afd58ab50.tar.zst
dexon-solidity-5b8a77398608689088938454583d284afd58ab50.zip
codegen: cleanup value types before storing them
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/codegen/LValue.cpp5
1 files changed, 5 insertions, 0 deletions
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.");