Closed Bug 1862627 Opened 11 months ago Closed 10 months ago

ColumnNumberWithOrigin::operator- uses wrong value on 1-origin

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: arai, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/11d085b63cf74b35737d9c036be80434883dd3f6/js/public/ColumnNumber.h#151-155

ColumnNumberOffset operator-(
    const ColumnNumberWithOrigin<Origin, LimitValue>& other) const {
  MOZ_ASSERT(valid());
  return ColumnNumberOffset(int32_t(value_) -
                            int32_t(other.zeroOriginValue()));

it should use other.value_, otherwise the result is wrong if Origin==1.
Luckily all subtract operation is done in Origin==0 right now, the issue doesn't happen,
but I'm about to migrate everything to use Origin==1 and it will hit the issue.

Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/6b4e5b983e99
Fix column number operation with 1-origin. r=iain
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: