Closed Bug 1546407 Opened 5 years ago Closed 5 years ago

Wasm baseline compiler: fix inconsistent indexing in MachineStackTracker::{set,is}GCPointer

Categories

(Core :: JavaScript: WebAssembly, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: jseward, Assigned: jseward)

References

Details

Attachments

(1 file)

MachineStackTracker::setGCPointer claims in a comment that its argument
|offsetFromSP| is an index up from the lowest address denoted by the stack
map. It implements that consistently with the comment.

MachineStackTracker::isGCPointer makes the same claim in a comment, but
actually implements the indexing in the opposite direction.

Blocks: 1546157

MachineStackTracker::setGCPointer claims in a comment that its argument
|offsetFromSP| is an index up from the lowest address denoted by the stack
map. It implements that consistently with the comment.

MachineStackTracker::isGCPointer makes the same claim in a comment, but
actually implements the indexing in the opposite direction.

This patch:

  • inverts the indexing direction of ::isGCPointer, making it consistent with
    the comments and with ::setGCPointer

  • changes the one-and-only use point of ::isGCPointer, in createStackMap(),
    accordingly. Rather than change the argument to ::isGCPointer, the
    iteration direction of the containing loop is inverted, since that fits
    better with the surrounding code.

Pushed by jseward@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cfafd091d301
Wasm baseline compiler: fix inconsistent indexing in MachineStackTracker::{set,is}GCPointer.  r=lhansen.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Assignee: nobody → jseward
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: