Closed
Bug 469072
Opened 16 years ago
Closed 16 years ago
outparam analysis confused by nsCOMPtr<>.forget(T**)
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bent.mozilla, Assigned: benjamin)
Details
Attachments
(1 file, 1 obsolete file)
20.86 KB,
patch
|
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
Just looked through the warning database on the static analysis tinderbox and was surprised to see my name in there so many times! I see lots of lines like this: /builds/static-analysis-buildbot/slave/full/build/dom/src/threads/nsDOMWorker.cpp:921: warning: outparam 'aNewObject' not written on NS_SUCCEEDED(return value) /builds/static-analysis-buildbot/slave/full/build/dom/src/threads/nsDOMWorker.cpp:912:48: outparam declared here WARN-DB: (3373, 0, 'dom/src/threads/nsDOMWorker.cpp', 921, "outparam 'aNewObject' not written on NS_SUCCEEDED(return value)", 'hg', 'Ben Turner <bent.mozilla@gmail.com>', 'dom/src/threads/nsDOMWorker.cpp', 'b83d3c8ac166e5f92f36fa44df498e74efd41832', 761) First, nsDOMWorker.cpp doesn't have 'aNewObject' anywhere line 921 (it's actually on line 802), so the numbers are off for some reason. But moving on, I can't actually see anything wrong with the function as nsCOMPtr<>.forget(T**) always sets the pointer value.
Assignee | ||
Comment 1•16 years ago
|
||
There's nothing *wrong* with the .forget function: it's just not annotated with NS_OUTPARAM, so the analysis doesn't know its semantics. The analysis is not cross-function, so it can't know the behavior of .forget() unless you tell it.
Assignee | ||
Comment 2•16 years ago
|
||
Argh, I didn't mean to include the nsExceptionService change in here.
Attachment #352554 -
Attachment is obsolete: true
Attachment #352556 -
Flags: review?(bent.mozilla)
Attachment #352554 -
Flags: review?(bent.mozilla)
Reporter | ||
Updated•16 years ago
|
Attachment #352556 -
Flags: review?(bent.mozilla) → review+
Reporter | ||
Comment 3•16 years ago
|
||
Comment on attachment 352556 [details] [diff] [review] Annotate various XPCOM functions, rev. 1.1 This looks great.
Assignee | ||
Comment 4•16 years ago
|
||
Pushed: http://hg.mozilla.org/mozilla-central/rev/dabc6a7b1d50
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•