mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Internals: Fix hash and comparison function for AstBasicDType (#4564)
This commit is contained in:
parent
4fdaa46328
commit
bba3487dc4
@ -277,11 +277,9 @@ int AstBasicDType::widthTotalBytes() const {
|
||||
|
||||
bool AstBasicDType::same(const AstNode* samep) const {
|
||||
const AstBasicDType* const sp = static_cast<const AstBasicDType*>(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 {
|
||||
|
@ -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();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user