Skip to content

MinifyImportsAndExports fails on duplicate names. #8203

@karlosz

Description

@karlosz

When running the minification pass with --minify-imports-and-exports-and-modules, the pass will fail with the following assertion:

Assertion failed: (res.second), function operator(), file MinifyImportsAndExports.cpp, line 118.
[1]    5104 abort      wasm-opt opt.wasm --enable-reference-types --enable-gc --enable-bulk-memory

This appears to be because the pass does not deal well with duplicate names, even if they come from different modules. In fact, duplicate imports even with the same module and name is explicitly allowed by the WebAssembly specification.

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