diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-10 21:41:50 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-12-01 00:41:46 +0800 |
commit | 0123e74a2eeac35bfa55886d0c6db391c07e7ec6 (patch) | |
tree | 2dc515eac632da436446211c1e8a5605653d2cef /libsolidity/codegen | |
parent | 03ccc6df704aae4ea19698f0167798013c14536e (diff) | |
download | dexon-solidity-0123e74a2eeac35bfa55886d0c6db391c07e7ec6.tar dexon-solidity-0123e74a2eeac35bfa55886d0c6db391c07e7ec6.tar.gz dexon-solidity-0123e74a2eeac35bfa55886d0c6db391c07e7ec6.tar.bz2 dexon-solidity-0123e74a2eeac35bfa55886d0c6db391c07e7ec6.tar.lz dexon-solidity-0123e74a2eeac35bfa55886d0c6db391c07e7ec6.tar.xz dexon-solidity-0123e74a2eeac35bfa55886d0c6db391c07e7ec6.tar.zst dexon-solidity-0123e74a2eeac35bfa55886d0c6db391c07e7ec6.zip |
codegen: cleanup booleans before storing them into memory
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/CompilerUtils.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp index ff0f8b9c..ce5bb1d2 100644 --- a/libsolidity/codegen/CompilerUtils.cpp +++ b/libsolidity/codegen/CompilerUtils.cpp @@ -950,6 +950,8 @@ unsigned CompilerUtils::prepareMemoryStore(Type const& _type, bool _padToWordBou else { solAssert(numBytes <= 32, "Memory store of more than 32 bytes requested."); + if (_type.category() == Type::Category::Bool) + m_context << Instruction::ISZERO << Instruction::ISZERO; if (numBytes != 32 && !leftAligned && !_padToWordBoundaries) // shift the value accordingly before storing m_context << (u256(1) << ((32 - numBytes) * 8)) << Instruction::MUL; |