(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?