TD: Ensure WalkerEdge is fully initialized
Coverity thinks that the edge_t is not getting fully initialized, so add a constructor to WalkerEdge that ensures the two components in question are set to zero (resulting in an invalid edge).
This commit is contained in:
committed by
Benjamin Nauck
parent
c252f40b6f
commit
c2df0a1315
@@ -450,6 +450,13 @@ std::vector<edge_t> EdgeWalker::getEmbeddingRow(int v)
|
||||
//*******************************************
|
||||
// WalkerEdge Methods
|
||||
//*******************************************
|
||||
WalkerEdge::WalkerEdge()
|
||||
{
|
||||
// Ensure the edge is properly initialized (Coverity defect 316559)
|
||||
ed.m_source = 0;
|
||||
ed.m_target = 0;
|
||||
}
|
||||
|
||||
bool WalkerEdge::isEqual(WalkerEdge w)
|
||||
{
|
||||
if ((v1 == w.v1 && v2 == w.v2) ||
|
||||
|
||||
@@ -71,14 +71,15 @@ using planar_embedding_t =
|
||||
class TechDrawExport WalkerEdge
|
||||
{
|
||||
public:
|
||||
WalkerEdge();
|
||||
static bool weCompare(WalkerEdge i, WalkerEdge j);
|
||||
bool isEqual(WalkerEdge w);
|
||||
std::string dump();
|
||||
|
||||
std::size_t v1;
|
||||
std::size_t v2;
|
||||
std::size_t v1 {0};
|
||||
std::size_t v2 {0};
|
||||
edge_t ed;
|
||||
std::size_t idx;
|
||||
std::size_t idx {0};
|
||||
};
|
||||
|
||||
class TechDrawExport ewWire
|
||||
|
||||
Reference in New Issue
Block a user