Skip to content

wasm-opt --flatten fails with exceptions or GC #8325

@juntyr

Description

@juntyr

When running wasm-opt on the following WASM file demo.wasm.zip, using -O4 or --flatten, the following exception is raised (tested in v124 and v125):

unexpected expr type
UNREACHABLE executed at /nix/var/nix/builds/nix-29457-2897100894/source/src/passes/Flatten.cpp:231

My complete command is

"wasm-opt" \
    "--enable-sign-ext" "--disable-threads" "--enable-mutable-globals" \
    "--enable-nontrapping-float-to-int" "--enable-simd" "--enable-bulk-memory" \
    "--enable-exception-handling" "--disable-tail-call" "--enable-reference-types" \
    "--enable-multivalue" "--disable-gc" "--disable-memory64" \
    "--disable-relaxed-simd" "--disable-extended-const" "--disable-strings" \
    "--disable-multimemory" "--strip-debug" "-O0" "--flatten" \
    "-o" "demo.opt.wasm" "demo.wasm"

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