You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/10/26 23:37:58 UTC
[jira] [Work logged] (TS-5009) CID 1022011 Logically dead code
[ https://issues.apache.org/jira/browse/TS-5009?focusedWorklogId=31181&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31181 ]
ASF GitHub Bot logged work on TS-5009:
--------------------------------------
Author: ASF GitHub Bot
Created on: 26/Oct/16 23:37
Start Date: 26/Oct/16 23:37
Worklog Time Spent: 10m
Work Description: GitHub user ngara opened a pull request:
https://github.com/apache/trafficserver/pull/1152
TS-5009 CID 1022011 Logically dead code removal
Please review - I changed this code to ink_release_assert instead of the following code, which seems to either return '\0' or *b->start(); but will ink_assert in debug mode.
ink_assert(!"out of range");
const: At condition !!b, the value of b must be equal to 0.
null: At condition !!b, the value of b must be NULL.
dead_error_condition: The condition !!b cannot be true.
700 if (unlikely(b)) {
CID 1022011 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: return b->start();.
701 return *b->start();
702 }
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ngara/trafficserver TS-5009
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafficserver/pull/1152.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1152
----
commit 1d169f17565dfe9f2042bd7a73b92420ab602898
Author: Nathan Garabedian <ng...@users.noreply.github.com>
Date: 2016-10-26T23:14:59Z
TS-5009 CID 1022011 Logically dead code removal
----
Issue Time Tracking
-------------------
Worklog Id: (was: 31181)
Time Spent: 10m
Remaining Estimate: 0h
> CID 1022011 Logically dead code
> -------------------------------
>
> Key: TS-5009
> URL: https://issues.apache.org/jira/browse/TS-5009
> Project: Traffic Server
> Issue Type: Bug
> Components: Core
> Reporter: Nathan Garabedian
> Assignee: Nathan Garabedian
> Time Spent: 10m
> Remaining Estimate: 0h
>
> TS_INLINE char &IOBufferReader::operator[](int64_t i)
> 686{
> 687 static char _error = '\0';
> 688 IOBufferBlock *b = block.get();
> 689
> 690 i += start_offset;
> cond_null: Condition b, taking false branch. Now the value of b is NULL.
> 691 while (b) {
> 692 int64_t bytes = b->read_avail();
> 693 if (bytes > i)
> 694 return b->start()[i];
> 695 i -= bytes;
> 696 b = b->next.get();
> 697 }
> 698
> 699 ink_assert(!"out of range");
> const: At condition !!b, the value of b must be equal to 0.
> null: At condition !!b, the value of b must be NULL.
> dead_error_condition: The condition !!b cannot be true.
> 700 if (unlikely(b)) {
>
> CID 1022011 (#1 of 1): Logically dead code (DEADCODE)
> dead_error_line: Execution cannot reach this statement: return b->start();.
> 701 return *b->start();
> 702 }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)