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

Trap on incorrect callbacktype signature #175

Closed
carllocos opened this issue May 11, 2023 · 1 comment
Closed

Trap on incorrect callbacktype signature #175

carllocos opened this issue May 11, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@carllocos
Copy link
Contributor

carllocos commented May 11, 2023

Currently, a callback of any type signature can be subscribed via primitive subscribe_interrupt. This is a problem because the callback handler expects registered callbacks to take 5 arguments given that the callback handler pushes 5 stack values prior setting up the call see resolve_event.

On top of my head, we could throw a trap when registering the callback via the subscribe_interrupt primitive. This avoids an out-of-context type mismatch fatal that the VM throws when

@tolauwae tolauwae added the duplicate This issue or pull request already exists label May 11, 2023
@tolauwae
Copy link
Member

This is exactly this feature request: #86
And this TODO:

// Validate argument count
// Callback function cannot return a result, should have return type void
// TODO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants