Closed Bug 1626170 Opened 5 years ago Closed 5 years ago

WasmOpIter.h should always call fail() when failing to read a byte

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: lth, Assigned: lth)

References

Details

Attachments

(1 file)

A number of readers in WasmOpIter.h will have a pattern like this:

  uint8_t tmp;
  if (!readFixedU8(&tmp)) {
    return false;
  }
  ...

This is wrong, because the decoding failure will be signaled as OOM instead of what it is, a decoding failure.

The byte readers in WasmOpIter.h do not themselves signal error beyond
returning false. The caller must always signal a proper error (or
delegate to another caller who does the signaling), or the decoding
error will ultimately be signaled as an OOM.

Attachment #9137045 - Attachment description: Bug 1626170 - Always fail properly when failing to read input. r?bbouvier → Bug 1626170 - Always fail properly when failing to read input. r=bbouvier
Pushed by lhansen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bef21a34ec25 Always fail properly when failing to read input. r=bbouvier
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: