Skip to content

Fuzz bug with return_call_ref of imported function reference #8031

Description

@tlively
;; primary.wast
(module
 (global $foo (export "foo") (mut funcref) (ref.func $foo))
 (func $foo)
)
;; secondary.wast
(module
 (type $f (func))
 (import "primary" "foo" (global $gimport$0 (mut funcref)))
 (func $bar (export "bar") (type $f)
  (return_call_ref $f
    (ref.cast (ref null $f)
      (global.get $gimport$0)
    )
  )
 )
)
$ wasm-opt -all primary.wast --fuzz-exec-before --fuzz-exec-second=secondary.wast
[fuzz-exec] running second module
[fuzz-exec] calling bar
Fatal: Module::getFunction: foo does not exist

Looks like the return call interpreter machinery does not look up function references in the correct instance.

Activity

  1. self-assigned this
    on Nov 8, 2025
  2. stevenfontanella commented on Jan 15, 2026

    @stevenfontanella
    Member

    Hopefully this would be fixed by #8180. Will check this example after updating the logic for function imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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