Closed Bug 1531269 Opened 1 year ago Closed 1 year ago

Fix bugs in BigInt.asUintN

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: wingo, Assigned: wingo)

References

Details

Attachments

(1 file)

There are a couple bugs in BigInt.asUintN.

One is that it currently fails to trim high zero digits off the result, invalidating the invariant that the most-significant-digit of a BigInt has at least one bit set.

The next is that when the result bit size is a multiple of the digit bit size, we shift a "mask" value by a full 64 (or 32) bits. It "works" fine on Intel but on ARM, such a shift will result in the top digit's bits all being masked off. Many thanks to Jakob Kummerow for the report.

Patch will fix these issues.

Priority: -- → P1
Keywords: checkin-needed

Pushed by nerli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8743fe149037
Fix bugs in BigInt.asUintN r=jwalden,terpri

Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.