Closed Bug 907547 Opened 12 years ago Closed 12 years ago

Remove unnecessary null-checks of nsCSSValue::BufferFromString()'s return value

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: dholbert, Assigned: dholbert)

References

()

Details

Attachments

(1 file)

Most callers of nsCSSValue::BufferFromString() null-check its return value, because it used to be fallible. However, bug 659963 changed it to be infallible -- in particular, it made us abort if nsStringBuffer::Alloc() fails.[1] That bug's patch remove a null-check from one BufferFromString caller[2], but it left behind others. Filing this bug on removing null-checks from the other callers. [1] http://hg.mozilla.org/mozilla-central/rev/67673422f7d2#l6.40 [2] http://hg.mozilla.org/mozilla-central/rev/67673422f7d2#l1.633
Attached patch fix v1Splinter Review
Attachment #793326 - Flags: review?(bzbarsky)
For reference, here's a link to the nsCSSValue::BufferFromString() impl: http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSValue.cpp?rev=dbc04a661a1a&mark=627-629,635-637#622 ...with its internal null-checks highlighted, which show that there's no way for that function to return null.
Attachment #793326 - Flags: review?(bzbarsky) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: