From 677700d5ac1c5079aa20a6a9e5667c7e8596da27 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 1 Jul 2017 11:48:12 +0100 Subject: Add assert to shift helper --- libsolidity/codegen/CompilerUtils.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libsolidity/codegen/CompilerUtils.cpp') 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); } -- cgit