Closed
Bug 1240492
Opened 10 years ago
Closed 10 years ago
[Static Analysis][Structurally dead code] In function ClosingService::AttachIOLayer from ClosingService.cpp
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
WONTFIX
| Tracking | Status | |
|---|---|---|
| firefox46 | --- | affected |
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1348511 )
Attachments
(1 obsolete file)
The Static Analysis tool Coverity added that dead code is present after return NS_OK:
>>// static
>>nsresult
>>ClosingService::AttachIOLayer(PRFileDesc *aFd)
>>{
>> // We are going to remove ClosingService soon.
>> // This change is going to turn it off, so ClosingService is not used.
>> // Bug 1238010.
>> return NS_OK;
>>
>> if (!sTcpUdpPRCloseLayerMethodsPtr) {
>> return NS_OK;
>> }
>>
>> PRFileDesc * layer;
>> PRStatus status;
>>
>> layer = PR_CreateIOLayerStub(sTcpUdpPRCloseLayerId,
>> sTcpUdpPRCloseLayerMethodsPtr);
>>
>> if (!layer) {
>> return NS_OK;
>> }
>>
>> ClosingLayerSecret *secret = new ClosingLayerSecret(sInstance);
>> layer->secret = reinterpret_cast<PRFilePrivate *>(secret);
>>
>> status = PR_PushIOLayer(aFd, PR_NSPR_IO_LAYER, layer);
>>
>> if (status == PR_FAILURE) {
>> delete secret;
>> PR_DELETE(layer);
>> }
>> return NS_OK;
>>}
We should remove the dead code, in the future if we consider that we need it we can always rollback the file.
| Assignee | ||
Comment 1•10 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/31217/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/31217/
Attachment #8708987 -
Flags: review?(mcmanus)
Comment 2•10 years ago
|
||
This is going away all together.
The code looks like this so that we can uplift it to aurora and beta. (when we return from that function earlier all ClosingService is actually not used, that is what we wanted)
Bug 1238017 - it is already in inbound but not central
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Updated•10 years ago
|
Attachment #8708987 -
Flags: review?(mcmanus)
| Assignee | ||
Updated•10 years ago
|
Attachment #8708987 -
Attachment is obsolete: true
You need to log in
before you can comment on or make changes to this bug.
Description
•