aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-01 18:48:12 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-07-03 06:41:22 +0800
commit677700d5ac1c5079aa20a6a9e5667c7e8596da27 (patch)
tree39ef837613d1362574a890d92db035df0b00573d /libsolidity
parentd2612655956f88938faba30bd00c9531a69142b4 (diff)
downloaddexon-solidity-677700d5ac1c5079aa20a6a9e5667c7e8596da27.tar
dexon-solidity-677700d5ac1c5079aa20a6a9e5667c7e8596da27.tar.gz
dexon-solidity-677700d5ac1c5079aa20a6a9e5667c7e8596da27.tar.bz2
dexon-solidity-677700d5ac1c5079aa20a6a9e5667c7e8596da27.tar.lz
dexon-solidity-677700d5ac1c5079aa20a6a9e5667c7e8596da27.tar.xz
dexon-solidity-677700d5ac1c5079aa20a6a9e5667c7e8596da27.tar.zst
dexon-solidity-677700d5ac1c5079aa20a6a9e5667c7e8596da27.zip
Add assert to shift helper
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index 94be90ab..7067ddd5 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -1013,11 +1013,13 @@ void CompilerUtils::cleanHigherOrderBits(IntegerType const& _typeOnStack)
void CompilerUtils::leftShiftNumberOnStack(unsigned _bits)
{
+ solAssert(_bits < 256, "");
m_context << (u256(1) << _bits) << Instruction::MUL;
}
void CompilerUtils::rightShiftNumberOnStack(unsigned _bits, bool _isSigned)
{
+ solAssert(_bits < 256, "");
m_context << (u256(1) << _bits) << Instruction::SWAP1 << (_isSigned ? Instruction::SDIV : Instruction::DIV);
}