diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-10 18:33:15 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-12-01 00:41:38 +0800 |
commit | 03ccc6df704aae4ea19698f0167798013c14536e (patch) | |
tree | e28cbda500c4f707a2ca46be03c27eec773d7de6 /libsolidity/codegen | |
parent | b16cdbb57e2f3bdc99b2cf367e40a7f78b4c72ee (diff) | |
download | dexon-solidity-03ccc6df704aae4ea19698f0167798013c14536e.tar.gz dexon-solidity-03ccc6df704aae4ea19698f0167798013c14536e.tar.zst dexon-solidity-03ccc6df704aae4ea19698f0167798013c14536e.zip |
codegen: truncate a boolean calldata down to one bit
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 d5361ac6..ff0f8b9c 100644 --- a/libsolidity/codegen/CompilerUtils.cpp +++ b/libsolidity/codegen/CompilerUtils.cpp @@ -925,6 +925,8 @@ unsigned CompilerUtils::loadFromMemoryHelper(Type const& _type, bool _fromCallda if (leftAligned) m_context << shiftFactor << Instruction::MUL; } + if (_fromCalldata && _type.category() == Type::Category::Bool) + m_context << Instruction::ISZERO << Instruction::ISZERO; return numBytes; } |