Skip to content

Commit

Permalink
clarify an _assert_reason optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Oct 24, 2021
1 parent cf5522c commit f81d581
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vyper/old_codegen/stmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ def _get_last(lll):
["mstore", buf - 32, 0x20],
["revert", buf - 36, ["add", 4 + 32 + 32, ["ceil32", _runtime_length]]],
]
if test_expr:

if test_expr is not None:
lll_node = ["if", ["iszero", test_expr], revert_seq]
else:
lll_node = revert_seq
Expand All @@ -212,7 +213,7 @@ def parse_Assert(self):

def parse_Raise(self):
if self.stmt.exc:
return self._assert_reason(0, self.stmt.exc)
return self._assert_reason(None, self.stmt.exc)
else:
return LLLnode.from_list(["revert", 0, 0], typ=None, pos=getpos(self.stmt))

Expand Down

0 comments on commit f81d581

Please sign in to comment.