Open
Bug 1217308
Opened 10 years ago
Updated 3 years ago
Static analysis incorrectly reports "Unused value of must-use type"
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox44 affected)
NEW
Tracking | Status | |
---|---|---|
firefox44 | --- | affected |
People
(Reporter: xidorn, Unassigned)
References
Details
See this error: https://treeherder.mozilla.org/logviewer.html#?job_id=12848952&repo=try
It reports:
> netwerk/base/TLSServerSocket.cpp:337:5: error: Unused value of must-use type 'already_AddRefed<nsITLSServerSecurityObserver>'
> observer = mSecurityObserver.forget();
> ^
The corresponding code is:
> 328: TLSServerConnectionInfo::~TLSServerConnectionInfo()
> 329: {
> 330: if (!mSecurityObserver) {
> 331: return;
> 332: }
> 333:
> 334: already_AddRefed<nsITLSServerSecurityObserver> observer;
> 335: {
> 336: MutexAutoLock lock(mLock);
> 337: observer = mSecurityObserver.forget();
> 338: }
> 339:
> 340: NS_ReleaseOnMainThread(Move(observer));
> 341: }
Obviously, `observer` is used in line 340, but it is incorrectly reported to be unused.
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•