Closed Bug 1546407 Opened 1 year ago Closed 1 year 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: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.