Closed Bug 1156028 Opened 11 years ago Closed 11 years ago

Teach clang-analyzer about XPCOM assertion macros

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

(Keywords: clang-analyzer)

Attachments

(1 file)

No description provided.
Seems to work. It changed the number of warnings found by scan-build from 1502 to 1452
Mostly impacting "Dereference of null pointer" but also "Argument with 'nonnull' attribute passed null", "Called C++ object pointer is null" & "Result of operation is garbage or undefined"
Comment on attachment 8594412 [details] [diff] [review] Teach clang-analyzer about XPCOM assertion macros Review of attachment 8594412 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/generic/nsImageFrame.cpp @@ +2225,1 @@ > if (NS_ConvertASCIItoUTF16(kIconLoadPrefs[i]) == nsDependentString(aData)) I wonder if it'd be worth making kIconLoadPrefs char16_t* so we avoid this conversion, even under DEBUG?
Attachment #8594412 - Flags: review?(nfroyd) → review+
(In reply to Sylvestre Ledru [:sylvestre] from comment #3) > Seems to work. It changed the number of warnings found by scan-build from > 1502 to 1452 Yes, I know. :-) I was using it over the weekend. Also see bug 1156029.
(In reply to Nathan Froyd [:froydnj] [:nfroyd] from comment #5) > Comment on attachment 8594412 [details] [diff] [review] > Teach clang-analyzer about XPCOM assertion macros > > Review of attachment 8594412 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: layout/generic/nsImageFrame.cpp > @@ +2225,1 @@ > > if (NS_ConvertASCIItoUTF16(kIconLoadPrefs[i]) == nsDependentString(aData)) > > I wonder if it'd be worth making kIconLoadPrefs char16_t* so we avoid this > conversion, even under DEBUG? Then we'd need to convert them to UTF-8 again before passing it to the Preferences API. Doesn't sound worth it.
Assignee: nobody → ehsan
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: