Skip to content

wat2wasm fails with call_indirect and relocation #1199

@skalogryz

Description

@skalogryz

The following code fails to compile by wat2wasm (v1.12) if relocatable binary (-r) is requested.
Is it expected? (exit code 0xC0000005)
Non-relocatable binary compiles just fine.

(module 
  ;; (type (func (param i32)(param i32)(result i32))) ;; fails, even if present
  (func $add (param i32)(param i32)(result i32)
    get_local 0
    get_local 1
    i32.add
    return
  )
  (table 1 anyfunc)
  (elem (i32.const 0) $add)
  (func $run
    i32.const 4444
    i32.const 5555
    i32.const 0
    ;;call_indirect (type 0) ;; fails
    call_indirect (param i32)(param i32)(result i32) ;; fails
    drop
  )
  (export "run" (func $run))
)

Metadata

Metadata

Assignees

No one assigned

    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