Skip to content

Commit

Permalink
handle empty seqs
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Sep 12, 2023
1 parent 106ff82 commit a665580
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions boa/vyper/ir_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def analyze(self):
self.args = [arg.analyze() for arg in self.args]
return self

# compile an IR "expr". called for its side effects on builder
def compile(self, out=None, out_typ=None):
# do a bit of metaprogramming to infer how to compile the args
if hasattr(self, "_argnames"):
Expand Down Expand Up @@ -745,6 +746,9 @@ class Seq(IRExecutor):
_name = "seq"

def compile(self, out=None, out_typ=None):
if len(self.args) == 0:
self.builder.append("pass")
return
for i, arg in enumerate(self.args):
if i + 1 < len(self.args):
# don't accidentally assign
Expand Down

0 comments on commit a665580

Please sign in to comment.