Don't use -1 to represent an unset nsCursor

RESOLVED FIXED in Firefox 57

Status

()

defect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

(Blocks 1 bug)

unspecified
mozilla57
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

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: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.