Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Jan 25, 2024

An out of bounds active segment traps during startup, which is an effect we must
preserve.

To avoid a regression here, ignore this in TNH mode (where the user assures us
nothing will trap), and also check if a segment will trivially be in bounds and not
trap (if so, it can be removed).

Fixes the remove-unused-module-elements part of #6230

The small change to an existing testcase made a segment there be in bounds,
to avoid this affecting it. Tests for this are in a new file.

@kripken kripken requested a review from tlively January 25, 2024 18:51
(func $func)
)

;; No bad segments: all element segments vanish. TODO: the function could too
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be interesting to test where the bad segment writes to a different memory than some other good segments, which could still be removed.

@kripken kripken enabled auto-merge (squash) January 25, 2024 20:48
@kripken kripken merged commit 662835a into WebAssembly:main Jan 25, 2024
@kripken kripken deleted the rume.tnh branch January 25, 2024 21:25
radekdoulik pushed a commit to dotnet/binaryen that referenced this pull request Jul 12, 2024
WebAssembly#6242)

An out of bounds active segment traps during startup, which is an effect we must
preserve.

To avoid a regression here, ignore this in TNH mode (where the user assures us
nothing will trap), and also check if a segment will trivially be in bounds and not
trap (if so, it can be removed).

Fixes the remove-unused-module-elements part of WebAssembly#6230

The small change to an existing testcase made a segment there be in bounds,
to avoid this affecting it. Tests for this are in a new file.
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants