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
{{ message }}
This repository has been archived by the owner on May 11, 2020. It is now read-only.
In a pretty standard (from what i can tell) wasm generated with emscripten it has the following imports
(import"env""memory" (memory(;0;)256256))
(import"env""table" (table(;0;)1414funcref))
;;with table def further down the file
(elem(;0;) (global.get1) 5022515128512351515152525224) ;;global 1 is just the mem base
and has no memory/table statement for the root module
This results in
The Root Module is decoded correctly
The Root Module has no Memory Sections or Table Sections
the LinearMemory space gets instantiated automatically
I can't seem to find much info on if this is per MVP spec or if its a hack for emscripten but should a root module instantiate its own table/memory when an imported module has these entries? Or am I missing something. I've played with various hacks..like inserting
//while resolving imports wasm/imports.go 209case ExternalTable:
ifint(index) >=len(importedModule.TableIndexSpace) {
returnInvalidTableIndexError(index)
}
//Inserted to setup module.Table if not already setup since import requires itifmodule.Table==nil{
module.Table=importedModule.Tablemoudile.TableIndexSpace=importedModule.TableIndexSpace
}
//end insertmodule.TableIndexSpace[0] =importedModule.TableIndexSpace[0]
module.imports.Tables++
which seems to give me the correct functionality.
If I'm on the right path I can prep a PR...if I'm way off base I can accept that also (:
Looking for insight. Thanks!
The text was updated successfully, but these errors were encountered:
Related to work for #163
In a pretty standard (from what i can tell) wasm generated with emscripten it has the following imports
and has no memory/table statement for the root module
This results in
the LinearMemory space gets instantiated automatically
wagon/wasm/module.go
Line 140 in 3fd3653
while the TableIndexSpace does not (as there is no Table Section)
wagon/wasm/module.go
Lines 141 to 143 in 3fd3653
Which causes a fault when importing the "env" modules table definition (line 213) as module.TableIndexSpace is undefnied
wagon/wasm/imports.go
Lines 209 to 214 in 3fd3653
I can't seem to find much info on if this is per MVP spec or if its a hack for emscripten but should a root module instantiate its own table/memory when an imported module has these entries? Or am I missing something. I've played with various hacks..like inserting
which seems to give me the correct functionality.
If I'm on the right path I can prep a PR...if I'm way off base I can accept that also (:
Looking for insight. Thanks!
The text was updated successfully, but these errors were encountered: