Skip to content

Commit

Permalink
added sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
HodanPlodky committed Dec 12, 2024
1 parent 7ab9781 commit 541a79e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vyper/venom/passes/literals_codesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 541a79e

Please sign in to comment.