Skip to content

Commit

Permalink
small simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Nov 26, 2024
1 parent 5053827 commit 4564b34
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions vyper/venom/passes/memmerging.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _opt():
elif inst.opcode == "mstore":
var = inst.operands[0]
dst = inst.operands[1]
if not (isinstance(dst, IRLiteral) and isinstance(var, IRVariable)):
if not isinstance(dst, IRLiteral) or not isinstance(var, IRVariable):
_opt()
continue
if var not in loads:
Expand Down Expand Up @@ -202,9 +202,7 @@ def _opt():
if not isinstance(var, IRVariable):
continue
src_inst = self.dfg.get_producing_instruction(var)
if src_inst is None:
continue
if src_inst.opcode != "calldatasize":
if src_inst is None or src_inst.opcode != "calldatasize":
continue
n_inter = _Interval(dst.value, dst.value, length.value, [inst])
if not self._add_interval(intervals, n_inter, ok_dst_overlap=True):
Expand Down

0 comments on commit 4564b34

Please sign in to comment.