Skip to content

MemoryPacking: Removing empty segments can remove a trap #6230

Description

@kripken
(module
 (memory $0 16 17)
 (data $0 (i32.const -1) "")
)
$ bin/wasm-opt a.wat --memory-packing --print
(module
 (memory $0 16 17)
)

Before the optimization this module traps during startup, as the segment offset is out of bounds.

We should probably make MemoryPacking not remove such segments unless TrapsNeverHappen is set, but perhaps there is a better idea?

Activity

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

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