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

var-get should throw a runtime error if variable does not exist #381

Open
csgui opened this issue Apr 17, 2024 · 0 comments
Open

var-get should throw a runtime error if variable does not exist #381

csgui opened this issue Apr 17, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@csgui
Copy link
Collaborator

csgui commented Apr 17, 2024

For now, var-get on an non-existing variable could lead to the generation of invalid Wasm code.

To remedy this, there is an "easy enough" fix to write:

  1. Change the linked function link_get_variable_fn to write an optional Value to the memory;
  2. Adapt the traverse function of get-var to unwrap the optional, and return a runtime error if it's none.
@Acaccia Acaccia added this to the WASM Phase 1 milestone Apr 17, 2024
@Acaccia Acaccia added the bug Something isn't working label Apr 17, 2024
@csgui csgui changed the title var-get should thrown a runtime error if variable does not exists var-get should throw a runtime error if variable does not exist Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Status: 📋 Backlog
Development

No branches or pull requests

2 participants