diff --git a/vyper/venom/passes/literals_codesize.py b/vyper/venom/passes/literals_codesize.py index 7a55d4975b..808433f418 100644 --- a/vyper/venom/passes/literals_codesize.py +++ b/vyper/venom/passes/literals_codesize.py @@ -52,6 +52,9 @@ def _process_bb(self, bb: IRBasicBlock): continue if not_the_shl_benefit > not_benefit and not_the_shl_benefit > shl_benefit: negated_ix -= 1 + # sanity check + assert (negated >> negated_ix) << negated_ix == negated, negated + assert (negated >> negated_ix) & 1 == 1, negated index = bb.instructions.index(inst) var = bb.parent.get_next_variable() new_inst = IRInstruction(