diff options
-rw-r--r-- | libsolidity/codegen/CompilerUtils.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp index 21dd2840..41559a42 100644 --- a/libsolidity/codegen/CompilerUtils.cpp +++ b/libsolidity/codegen/CompilerUtils.cpp @@ -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; } } |