diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index ccd0c24ed..df65365c4 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -277,11 +277,9 @@ int AstBasicDType::widthTotalBytes() const { bool AstBasicDType::same(const AstNode* samep) const { const AstBasicDType* const sp = static_cast(samep); - if (!rangep() && !sp->rangep() && m == sp->m) { - return true; - } else { - return m == sp->m && rangep() && rangep()->sameTree(sp->rangep()); - } + if (!(m == sp->m) || numeric() != sp->numeric()) return false; + if (!rangep() && !sp->rangep()) return true; + return rangep() && rangep()->sameTree(sp->rangep()); } int AstNodeUOrStructDType::widthTotalBytes() const { diff --git a/src/V3Hasher.cpp b/src/V3Hasher.cpp index f0a4d2bfa..0e13e18d5 100644 --- a/src/V3Hasher.cpp +++ b/src/V3Hasher.cpp @@ -143,6 +143,7 @@ private: void visit(AstBasicDType* nodep) override { m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { m_hash += nodep->keyword(); + m_hash += nodep->numeric(); m_hash += nodep->nrange().left(); m_hash += nodep->nrange().right(); });