Skip to content

Wasm backend: ensure correct translation of Wasm_ir.global_(get|set) #157

@pkel

Description

@pkel

While working on a different issue, I skimmed the following lines. The use of LocalGet / LocalSet where we want to handle global variables is almost certainly a bug.

let local_get i _ = GetLocal (Int32.of_int i @@ no_region)
let local_set i _ = SetLocal (Int32.of_int i @@ no_region)
let local_tee i _ = TeeLocal (Int32.of_int i @@ no_region)
let global_get x ctx = GetLocal (global_to_spec ctx x)
let global_set x ctx = SetLocal (global_to_spec ctx x)

I want to add tests and fix the bug.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions