This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Module { | |
| type_section: Some( | |
| TypeSection( | |
| [ | |
| FuncType { | |
| params: [], | |
| return_types: [ | |
| I32 | |
| ] | |
| } | |
| ] | |
| ) | |
| ), | |
| function_section: Some( | |
| FunctionSection( | |
| [ | |
| Type( | |
| 0 | |
| ) | |
| ] | |
| ) | |
| ), | |
| table_section: Some( | |
| TableSection( | |
| [ | |
| Table { | |
| elmtype: Anyfunc, | |
| limit: Limit { | |
| min: 0, | |
| max: None | |
| } | |
| } | |
| ] | |
| ) | |
| ), | |
| memory_section: Some( | |
| MemorySection( | |
| [ | |
| Mem( | |
| Limit { | |
| min: 0, | |
| max: Some( | |
| 1 | |
| ) | |
| } | |
| ) | |
| ] | |
| ) | |
| ), | |
| global_section: None, | |
| export_section: Some( | |
| ExportSection( | |
| [ | |
| Export { | |
| name: "memory", | |
| description: ExportDescription( | |
| Mem( | |
| 0 | |
| ) | |
| ) | |
| }, | |
| Export { | |
| name: "main", | |
| description: ExportDescription( | |
| Func( | |
| 0 | |
| ) | |
| ) | |
| } | |
| ] | |
| ) | |
| ), | |
| code_section: Some( | |
| CodeSection( | |
| [ | |
| Code { | |
| locals: [], | |
| instructions: [ | |
| I32Const( | |
| 0 | |
| ) | |
| ] | |
| } | |
| ] | |
| ) | |
| ) | |
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (module | |
| (table 0 anyfunc) | |
| (memory $0 1) | |
| (export "memory" (memory $0)) | |
| (export "main" (func $main)) | |
| (func $main (result i32) | |
| (i32.const 0) | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(responding to your comment on #WebAssembly irc)
Yeah, it's not super clear from the spec doc, but basically a given function uses the same index into the function section and the code section. It basically splits the func into two parts where
typeis defined in the function section andlocalsandbodyare defined in the code section.