-
Notifications
You must be signed in to change notification settings - Fork 72
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
Spec module global instantiation is incorrect #571
Comments
If you allocate the vector to hold the globals and then evaluate the initializer expressions, there's no problem, right? Is there a specific part of the spec that says something incorrect? |
The Instantiation section actually has a note addressing this:
That said, I have plans to refactor the module rules to be more sequential, but that's currently low priority. |
Hey @tlively Sure so here on allocation it mentions passing in the global initializer values as a prior, it's impossible to compute these before allocation because their expressions can call global get and globals are not yet allocated.
...
|
This also applies to element segment initial expressions also in the spec, data segments are already after module allocation so they are fine as they are. @rossberg |
As globals can now have initial expressions that point to other globals, it's not possible to compute all the initialiser expressions into a vector ahead of global allocation.
For example
The second initialiser here would call global.get on a yet to be allocated global
Instead we should probably do
for each global in module
The text was updated successfully, but these errors were encountered: