Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where explicit return of implicit empty truple crashes the compiler #261

Merged
merged 1 commit into from
Feb 20, 2021

Conversation

cburgdorf
Copy link
Collaborator

@cburgdorf cburgdorf commented Feb 19, 2021

What was wrong?

These two methods should both be treated as returning ()

  pub def explicit_return():
    return

  pub def implicit():
    pass

Without this change, the explicit_return crashes the compiler.

How was it fixed?

Treat a None value in FuncStmt::Return as having an expression with an empty tuple.

@cburgdorf cburgdorf changed the title Fix issue where explicit return results in crash Fix issue where explicit return of implicit empty truple results in crash Feb 19, 2021
@cburgdorf cburgdorf changed the title Fix issue where explicit return of implicit empty truple results in crash Fix issue where explicit return of implicit empty truple crashes the compiler Feb 19, 2021
@cburgdorf cburgdorf merged commit f2c2204 into ethereum:master Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants