hashlib: prevent naive hashing of IdString when hashing SigBit

This commit is contained in:
Emil J. Tywoniak 2024-10-30 11:48:54 +01:00
parent 4d14399749
commit b7991ed1f5
1 changed files with 3 additions and 1 deletions

View File

@ -1824,8 +1824,10 @@ inline bool RTLIL::SigBit::operator!=(const RTLIL::SigBit &other) const {
inline Hasher RTLIL::SigBit::hash_acc(Hasher h) const {
if (wire) {
h = wire->name.hash_acc(h);
h.acc(offset);
// hash_acc isn't allowed to come first, or it might hash trivially
// and possibly ruin things
h = wire->name.hash_acc(h);
return h;
}
h.acc(data);