Closed Bug 1541770 Opened 7 months ago Closed 6 months ago

Allow data.drop / elem.drop without memory or tables

Categories

(Core :: Javascript: WebAssembly, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: lth, Assigned: jseward)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Firefox will reject data.drop and elem.drop if there is no memory or table in the module, but this is apparently a bug according to the current spec, see https://github.com/WebAssembly/bulk-memory-operations/issues/79. I've asked for clarification but we may have to lift this restriction.

We can wait a few days to see if there's any more discussion but if not we should consider this a bug on our side.

Assignee: nobody → jseward

Discussion resolved; we need to fix this.

Our Wasm implementations current reject data.drop and elem.drop if there is no
memory or table in the module. This isn't consistent with the current
bulk-memory specification, though.
See https://github.com/WebAssembly/bulk-memory-operations/issues/79.

This patch fixes that by slightly loosening the relevant checks, so as to
allow a segment to be dropped even if there is no memory, providing that that
segment is a passive one.

Most of the changes are in the test file passive-segs-nonboundary.js:

  • There are four new checks for data.drop without memory and the equivalents
    for table.drop.

  • Test construction function do_test has been made more flexible, so it is
    now possible to independently specify whether a table/memory is present,
    whether active initialisers are present, and whether passive initialisers
    are present.

In WasmModule.cpp, a couple of places where a segment vector was asserted to
be empty have been changed to assert that it contains only passive segments.
Attempts to do this using std::all_of and a closure were unsuccessful (see bug
1547031) and instead a debug-only helper function AllSegmentsArePassive was
added.

Pushed by jseward@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e81669455530
Allow data.drop / elem.drop without memory or tables.  r=lhansen.
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.