Closed Bug 408772 Opened 17 years ago Closed 17 years ago

"ASSERTION: nscoord addition will reach or pass nscoord_MAX" on attachment 267831 [details]

Categories

(Core :: Layout, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

Details

(Keywords: assertion)

Attachments

(1 file)

Attached patch patchSplinter Review
Attachment 267831 [details] (from bug 383887) triggers:
###!!! ASSERTION: nscoord addition will reach or pass nscoord_MAX: '(PRInt64)a
+ (PRInt64)b < (PRInt64)nscoord_MAX', file ../../dist/include/gfx/nsCoord.h,
line 153

This was mentioned in
  https://bugzilla.mozilla.org/show_bug.cgi?id=383887#c12

I diagnosed this in
  https://bugzilla.mozilla.org/show_bug.cgi?id=383887#c17
and I'm attaching a patch.
Comment on attachment 293619 [details] [diff] [review]
patch

Summary of patch:
  Replace nscoord_MAX-unsafe arithmetic with safe call to NSCoordSaturatingSubtract.


Note: The third argument (nscoord_MAX) doesn't affect anything, because it only comes into play when we're doing nscoord_MAX - nscoord_MAX, and that shouldn't happen here because scrollbarWidth should never be that big.
Attachment #293619 - Flags: superreview?(roc)
Attachment #293619 - Flags: review?(roc)
Comment on attachment 293619 [details] [diff] [review]
patch

r+sr=bzbarsky.  Sorry for this screwup; I haven't gotten used to the saturating stuff yet.  :(
Attachment #293619 - Flags: superreview?(roc)
Attachment #293619 - Flags: superreview+
Attachment #293619 - Flags: review?(roc)
Attachment #293619 - Flags: review+
Attachment #293619 - Flags: approval1.9?
Assignee: nobody → dholbert
Keywords: assertion
Attachment #293619 - Flags: approval1.9? → approval1.9+
patch checked in:

Checking in nsComboboxControlFrame.cpp;
/cvsroot/mozilla/layout/forms/nsComboboxControlFrame.cpp,v  <--  nsComboboxControlFrame.cpp
new revision: 1.425; previous revision: 1.42
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: