Opened 9 years ago
Closed 9 years ago
#6299 closed defect (fixed)
Logic error in GNMGenericNetwork::LoadGraph()
Reported by: | Even Rouault | Owned by: | bishop |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | gnm |
Cc: |
Description (last modified by )
Coverity Scan raises that the following tests in GNMGenericNetwork::LoadGraph() can only evaluate to FALSE since they are in a block controlled by if(bIsBlock) but "bool bIsBlock = GNM_BLOCK_NONE == nBlockState;"
if(nBlockState & GNM_BLOCK_SRC) m_oGraph.ChangeBlockState(nSrcFID, bIsBlock); if(nBlockState & GNM_BLOCK_TGT) m_oGraph.ChangeBlockState(nTgtFID, bIsBlock); if(nBlockState & GNM_BLOCK_CONN) m_oGraph.ChangeBlockState(nConFID, bIsBlock);
The warning (KS 138329 Logically dead code) looks justified.
Change History (4)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Any reason to keep the ticket opened ? r32914 seems like the appropriate fix.
comment:4 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
There is an logical error (fixed in r32914) as bIsBlock should be true if nBlockState != GNM_BLOCK_NONE.
But nBlockState can take different values or combination of values:
So bIsBlock is not always FALSE.