mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add assert to shift helper
This commit is contained in:
parent
d261265595
commit
677700d5ac
@ -1013,11 +1013,13 @@ void CompilerUtils::cleanHigherOrderBits(IntegerType const& _typeOnStack)
|
|||||||
|
|
||||||
void CompilerUtils::leftShiftNumberOnStack(unsigned _bits)
|
void CompilerUtils::leftShiftNumberOnStack(unsigned _bits)
|
||||||
{
|
{
|
||||||
|
solAssert(_bits < 256, "");
|
||||||
m_context << (u256(1) << _bits) << Instruction::MUL;
|
m_context << (u256(1) << _bits) << Instruction::MUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilerUtils::rightShiftNumberOnStack(unsigned _bits, bool _isSigned)
|
void CompilerUtils::rightShiftNumberOnStack(unsigned _bits, bool _isSigned)
|
||||||
{
|
{
|
||||||
|
solAssert(_bits < 256, "");
|
||||||
m_context << (u256(1) << _bits) << Instruction::SWAP1 << (_isSigned ? Instruction::SDIV : Instruction::DIV);
|
m_context << (u256(1) << _bits) << Instruction::SWAP1 << (_isSigned ? Instruction::SDIV : Instruction::DIV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user