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 an assert in call.c when checking an invalid argument for autorecover #4278

Merged
merged 2 commits into from
Dec 20, 2022

Conversation

chalcolith
Copy link
Member

The following code crashes the compiler, because {(ISize)} iso^ is an invalid type, and when we check its arg for autorecovery, there is no type to check:

class val Info
  let fn: {(ISize)} iso

  new val create(fn': {(ISize)} iso^) =>
    fn = fn'

  fun call(n: ISize) =>
    fn(n)

actor Main
  new create(env: Env) =>
    let info = Info({(n: ISize) => env.out.print("n = " + n.string()) })
    info.call(123)

This PR adds a null check so we won't assert on the invalid parameter type.

…ecover

The following code crashes the compiler, because `{(ISize)} iso^` is an invalid type, and when we check its arg for autorecovery, there is no type to check:

```
class val Info
  let fn: {(ISize)} iso

  new val create(fn': {(ISize)} iso^) =>
    fn = fn'

  fun call(n: ISize) =>
    fn(n)

actor Main
  new create(env: Env) =>
    let info = Info({(n: ISize) => env.out.print("n = " + n.string()) })
    info.call(123)
```

This PR adds a null check so we won't assert on the invalid parameter type.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Dec 16, 2022
@chalcolith chalcolith added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Dec 16, 2022
@ponylang-main
Copy link
Contributor

Hi @kulibali,

The changelog - fixed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 4278.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

@chalcolith chalcolith requested a review from a team December 16, 2022 22:48
@SeanTAllen
Copy link
Member

Is there an open issue this fixes?

@SeanTAllen SeanTAllen removed the discuss during sync Should be discussed during an upcoming sync label Dec 20, 2022
@chalcolith chalcolith merged commit e1fda53 into main Dec 20, 2022
@chalcolith chalcolith deleted the fix_assert_in_call branch December 20, 2022 21:50
github-actions bot pushed a commit that referenced this pull request Dec 20, 2022
github-actions bot pushed a commit that referenced this pull request Dec 20, 2022
@SeanTAllen
Copy link
Member

@kulibali is there an associated issue for this that needs to be closed?

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Dec 20, 2022
@chalcolith
Copy link
Member Author

No, there's no issue.

@jemc jemc removed the discuss during sync Should be discussed during an upcoming sync label Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants