Skip to content

Commit

Permalink
flush keepalives on empty return statements
Browse files Browse the repository at this point in the history
  • Loading branch information
zsol committed Jul 16, 2022
1 parent 227e50d commit d262023
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mypyc/irbuild/statement.py
Expand Up @@ -70,6 +70,7 @@ def transform_return_stmt(builder: IRBuilder, stmt: ReturnStmt) -> None:
retval = builder.accept(stmt.expr)
else:
retval = builder.builder.none()
builder.flush_keep_alives()
retval = builder.coerce(retval, builder.ret_types[-1], stmt.line)
builder.nonlocal_control[-1].gen_return(builder, retval, stmt.line)

Expand Down

0 comments on commit d262023

Please sign in to comment.