Closed Bug 1400148 Opened 3 years ago Closed 3 years ago

Don't use -1 to represent an unset nsCursor

Categories

(Core :: Widget, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: njn, Assigned: njn)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Because UBSan complains about casting -1:

> runtime error: load of value 4294967295, which is not a valid value for type 'nsCursor'
Comment on attachment 8908483 [details] [diff] [review]
Don't use -1 to represent an unset nsCursor

Nice, thanks.

>+                // This one is used for array sizing, and so better be the last
>+                // one in this list...
>+                eCursorCount,
>+
>+                // ...except for this one.
>+                eCursorInvalid = 255

eCursorCount + 1 perhaps.  I couldn't see how long the list was from the patch, but whatever is fine.
Attachment #8908483 - Flags: review?(karlt) → review+
or -1, even...
https://hg.mozilla.org/mozilla-central/rev/ff9e183ca0fe
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.