[ruby/prism] Better hashing between positive/negative integers

https://github.com/ruby/prism/commit/68ddf08634
This commit is contained in:
Kevin Newton 2024-02-29 09:39:57 -05:00 committed by git
parent 950c60623b
commit cb784082bc

View File

@ -61,6 +61,10 @@ node_hash(const pm_parser_t *parser, const pm_node_t *node) {
hash ^= murmur_hash((const uint8_t *) value, sizeof(uint32_t));
}
if (integer->negative) {
hash ^= murmur_scramble((uint32_t) 1);
}
return hash;
}
case PM_SOURCE_LINE_NODE: {