From 047a08c9993f3d1c2f04e46ee4c96bb0e25d1ea0 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 16 Jun 2018 18:00:21 -0400 Subject: [PATCH] Internals: Clean some UASSERTs. No functional change. --- src/V3Ast.h | 4 ++-- src/V3GraphTest.cpp | 9 ++++++--- src/V3Param.cpp | 8 ++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/V3Ast.h b/src/V3Ast.h index 99834f529..d45b354f3 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -364,8 +364,8 @@ public: return names[m_e]; }; static void selfTest() { - UASSERT(0==strcmp(AstBasicDTypeKwd(_ENUM_MAX).ascii()," MAX"),"Enum array mismatch"); - UASSERT(0==strcmp(AstBasicDTypeKwd(_ENUM_MAX).dpiType()," MAX"),"Enum array mismatch"); + UASSERT(0==strcmp(AstBasicDTypeKwd(_ENUM_MAX).ascii()," MAX"), "SelfTest: Enum mismatch"); + UASSERT(0==strcmp(AstBasicDTypeKwd(_ENUM_MAX).dpiType()," MAX"),"SelfTest: Enum mismatch"); } inline AstBasicDTypeKwd () : m_e(UNKNOWN) {} // cppcheck-suppress noExplicitConstructor diff --git a/src/V3GraphTest.cpp b/src/V3GraphTest.cpp index 4d64b3084..963e9b05a 100644 --- a/src/V3GraphTest.cpp +++ b/src/V3GraphTest.cpp @@ -119,9 +119,12 @@ public: gp->stronglyConnected(&V3GraphEdge::followAlwaysTrue); dump(); - UASSERT(i->color()!=a->color() && a->color() != g2->color() && g2->color() != q->color(), "Separate colors not assigned"); - UASSERT(a->color()==b->color() && a->color()==g1->color(), "Strongly connected nodes not colored together"); - UASSERT(g2->color()==g3->color(), "Strongly connected nodes not colored together"); + UASSERT(i->color()!=a->color() && a->color() != g2->color() && g2->color() != q->color(), + "SelfTest: Separate colors not assigned"); + UASSERT(a->color()==b->color() && a->color()==g1->color(), + "SelfTest: Strongly connected nodes not colored together"); + UASSERT(g2->color()==g3->color(), + "SelfTest: Strongly connected nodes not colored together"); } }; diff --git a/src/V3Param.cpp b/src/V3Param.cpp index adbbcc93e..a41f966d7 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -197,12 +197,16 @@ private: // Find it in the clone structure //UINFO(8,"Clone find 0x"<modVarp()<find(pinp->modVarp()); - UASSERT(cloneiter != clonemapp->end(), "Couldn't find pin in clone list"); + if (cloneiter == clonemapp->end()) { + pinp->v3fatalSrc("Couldn't find pin in clone list"); + } pinp->modVarp(cloneiter->second->castVar()); } else if (pinp->modPTypep()) { CloneMap::iterator cloneiter = clonemapp->find(pinp->modPTypep()); - UASSERT(cloneiter != clonemapp->end(), "Couldn't find pin in clone list"); + if (cloneiter == clonemapp->end()) { + pinp->v3fatalSrc("Couldn't find pin in clone list"); + } pinp->modPTypep(cloneiter->second->castParamTypeDType()); } else {