Closed
Bug 1240484
Opened 9 years ago
Closed 9 years ago
[Static Analysis][Nesting level does not match indentation] In function ShutdownXPCOM from XPCOMInit.cpp
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox45 | --- | unaffected |
firefox46 | --- | fixed |
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1348593 )
Attachments
(1 file)
The Static Analysis tool Coverity added that there could be a control flow issue, on the following code:
>> if (observerService)
>> mozilla::KillClearOnShutdown(ShutdownPhase::ShutdownThreads);
>> observerService->NotifyObservers(nullptr,
>> NS_XPCOM_SHUTDOWN_THREADS_OBSERVER_ID,
>> nullptr);
As it can be seen from the above code, i think there should be brackets and the actual if branch should look like this, specially that observerService is null checked and dereferenced later on:
>> if (observerService)
>> {
>> mozilla::KillClearOnShutdown(ShutdownPhase::ShutdownThreads);
>> observerService->NotifyObservers(nullptr,
>> NS_XPCOM_SHUTDOWN_THREADS_OBSERVER_ID,
>> nullptr);
>> }
Assignee | ||
Comment 1•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/31203/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/31203/
Assignee | ||
Updated•9 years ago
|
Attachment #8708971 -
Flags: review?(continuation)
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8708971 [details]
MozReview Request: Bug 1240484 - fixed control flow patch issue by adding brackets. r?mccr8
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/31203/diff/1-2/
Attachment #8708971 -
Attachment description: MozReview Request: Bug 1240484 - fixed control flow patch issue by adding brackets. r?continuation@gmail.com → MozReview Request: Bug 1240484 - fixed control flow patch issue by adding brackets. r?mccr8
Comment 3•9 years ago
|
||
Nice. It looks like the dropped check only because an issue in bug 1237794.
I don't understand why the brace for this if block wasn't added in bug 1046841, but oh well.
Blocks: 1237794
Comment 4•9 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #3)
> Nice. It looks like the dropped check only because an issue in bug 1237794.
I meant, "only became an issue in bug 1237794".
Comment 5•9 years ago
|
||
Comment on attachment 8708971 [details]
MozReview Request: Bug 1240484 - fixed control flow patch issue by adding brackets. r?mccr8
https://reviewboard.mozilla.org/r/31203/#review27993
Attachment #8708971 -
Flags: review?(continuation) → review+
Updated•9 years ago
|
status-firefox45:
--- → unaffected
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Comment 7•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•