codegen: shorten the bit truncation

This commit is contained in:
Yoichi Hirai 2016-11-24 17:03:17 +01:00
parent 9d25b5601e
commit fa486f5b44
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992

View File

@ -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;
}
}