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)
|
||||
m_context
|
||||
<< (u256(1) << (256 - typeOnStack.numBits()))
|
||||
<< Instruction::SWAP1
|
||||
<< Instruction::DUP2
|
||||
<< Instruction::MUL
|
||||
<< Instruction::DIV;
|
||||
<< ((u256(1) << typeOnStack.numBits()) - 1)
|
||||
<< Instruction::AND;
|
||||
chopSignBitsPending = false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user