Closed
Bug 1156028
Opened 11 years ago
Closed 11 years ago
Teach clang-analyzer about XPCOM assertion macros
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla40
| Tracking | Status | |
|---|---|---|
| firefox40 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
(Keywords: clang-analyzer)
Attachments
(1 file)
|
5.52 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8594412 -
Flags: review?(nfroyd)
Comment 3•11 years ago
|
||
Seems to work. It changed the number of warnings found by scan-build from 1502 to 1452
Comment 4•11 years ago
|
||
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"
Updated•11 years ago
|
Keywords: clang-analyzer
Comment 5•11 years ago
|
||
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+
| Assignee | ||
Comment 6•11 years ago
|
||
(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.
| Assignee | ||
Comment 7•11 years ago
|
||
(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
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•