Skip to content

Fuzzer generates invalid code for table initializers #8911

Description

@stevenfontanella

I ran --translate-to-fuzz on the following seed file:

(module
  (import "env" "table" (table 1 1 (ref exn)))
)
 bin/wasm-opt -ttf -if seed.wast -all /dev/null -o /dev/null

And hit a fatal error that validation failed, since a ref.as_non_null was generated in a constant expression (the table initializer):

[wasm-validator error in module] unexpected false: table initializer value must be constant, on
...
 (table $timport$0 1 1 (ref exn) (ref.as_non_null
  (ref.null noexn)
 ))

It looks like it's caused by the code described here.

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