mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
codegen: cleanup booleans before storing them into memory
This commit is contained in:
parent
03ccc6df70
commit
0123e74a2e
@ -950,6 +950,8 @@ unsigned CompilerUtils::prepareMemoryStore(Type const& _type, bool _padToWordBou
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
solAssert(numBytes <= 32, "Memory store of more than 32 bytes requested.");
|
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)
|
if (numBytes != 32 && !leftAligned && !_padToWordBoundaries)
|
||||||
// shift the value accordingly before storing
|
// shift the value accordingly before storing
|
||||||
m_context << (u256(1) << ((32 - numBytes) * 8)) << Instruction::MUL;
|
m_context << (u256(1) << ((32 - numBytes) * 8)) << Instruction::MUL;
|
||||||
|
Loading…
Reference in New Issue
Block a user