mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
codegen: shorten the bit truncation
This commit is contained in:
parent
9d25b5601e
commit
fa486f5b44
@ -492,11 +492,8 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp
|
|||||||
{
|
{
|
||||||
if (typeOnStack.numBits() < 256)
|
if (typeOnStack.numBits() < 256)
|
||||||
m_context
|
m_context
|
||||||
<< (u256(1) << (256 - typeOnStack.numBits()))
|
<< ((u256(1) << typeOnStack.numBits()) - 1)
|
||||||
<< Instruction::SWAP1
|
<< Instruction::AND;
|
||||||
<< Instruction::DUP2
|
|
||||||
<< Instruction::MUL
|
|
||||||
<< Instruction::DIV;
|
|
||||||
chopSignBitsPending = false;
|
chopSignBitsPending = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user