Closed Bug 1182370 Opened 5 years ago Closed 5 years ago

_BitScanReverse does not modify `*pIndex` if input is zero

Categories

(Core :: MFBT, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: jgilbert, Assigned: jgilbert)

Details

Attachments

(1 file)

MSVC code analysis complains about this.

https://msdn.microsoft.com/en-us/library/fbxyd7zd.aspx

_BitScanReverse doesn't modify `*pIndex` is the input is all zeros. We need to either test for this before-hand, or test the retval from _BitScanReverse, which is zero if input is zero. (non-zero otherwise)
Attachment #8631949 - Flags: review?(jwalden+bmo)
Attachment #8631949 - Flags: review?(jwalden+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/5b4a4d8e5a80
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.