You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is undefined behavior(heh) when importing functions which do not have a matching type definition in the file. Nothing breaks though, it seems like the function gets a random(?) function index assigned to it. I'm not sure how this is working, but this should be a syntax error.
Types are one of the first sections of a WebAssembly module. When we import from the environment we only have an identifier for the type; it get's written as a placeholder to the type index. Once we encounter the type definition, we patch it. When we don't though, we encode the placeholder type, whatever that may be.
Expected behavior
Undefined types should through
Notes
The work for this is slightly tricky since we never parse the tokens twice. And this should be part of a stand-alone sanity check/validation once we are done parsing all of the tokens. This could be the first validation. So far these usually end up in runtime errors.
The text was updated successfully, but these errors were encountered:
Overview
There is undefined behavior(heh) when importing functions which do not have a matching type definition in the file. Nothing breaks though, it seems like the function gets a random(?) function index assigned to it. I'm not sure how this is working, but this should be a syntax error.
Types are one of the first sections of a WebAssembly module. When we import from the environment we only have an identifier for the type; it get's written as a placeholder to the type index. Once we encounter the type definition, we patch it. When we don't though, we encode the placeholder type, whatever that may be.
Expected behavior
Undefined types should through
Notes
The work for this is slightly tricky since we never parse the tokens twice. And this should be part of a stand-alone sanity check/validation once we are done parsing all of the tokens. This could be the first validation. So far these usually end up in runtime errors.
The text was updated successfully, but these errors were encountered: