mirror of
https://github.com/ziglang/zig.git
synced 2025-12-12 09:13:11 +00:00
Value.hashPtr: handle lazy_align as an integer
Although lazy_align is a different tag than integer values, it needs to be hashed and equality-tested as if it were a simple integer. Otherwise our basic data structure guarantees fall apart.
This commit is contained in:
parent
c38b4bcee7
commit
7e47f106cc
@ -2476,15 +2476,9 @@ pub const Value = extern union {
|
||||
.bool_false,
|
||||
.bool_true,
|
||||
.the_only_possible_value,
|
||||
.lazy_align,
|
||||
=> return hashInt(ptr_val, hasher, target),
|
||||
|
||||
.lazy_align => {
|
||||
// Bit weird to have this here but this function is also called
|
||||
// on integers.
|
||||
const ty = ptr_val.castTag(.lazy_align).?.data;
|
||||
ty.hashWithHasher(hasher, target);
|
||||
},
|
||||
|
||||
else => unreachable,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user