runtimeverification / runtimeverification/wasm-semantics
Handle `global.get` in element segments
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 106
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/WebAssembly/spec/commit/c2b3446682f79de5c0c676960b8380c1b9c924ae introduces a change to the conformance tests, which makes the interpreter fail on this function evaluation:
#t2aElemExpr < ctx (... localIds: .Map , globalIds: .Map , funcIds: #freshId ( 0 ) |-> 0 , typeIds: $out-i32 |-> 0 , tableIds: .Map , elemIds: .Map , memoryIds: .Map ) > ( ( item global.get 0 .EmptyStmts ) )
The source that causes this:
(module $module4
(func (result i32)
i32.const 42
)
(global (export "f") funcref (ref.func 0))
)
(register "module4" $module4)
(module
(import "module4" "f" (global funcref))
(type $out-i32 (func (result i32)))
(table 10 funcref)
(elem (offset (i32.const 0)) funcref (global.get 0))
(func (export "call_imported_elem") (type $out-i32)
(call_indirect (type $out-i32) (i32.const 0))
)
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the conformance-test change in WebAssembly/spec commit c2b3446682f79de5c0c676960b8380c1b9c924ae and reproduce the failing #t2aElemExpr evaluation in the interpreter. Trace handling of the shown element segment containing global.get 0 and compare it with the supplied module; done means this case evaluates successfully without the reported failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100