diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-03-28 12:03:58 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-28 12:05:08 -0700 |
| commit | 7e47f106ccf73af4c890ecbb4d48e9e92d38d3c4 (patch) | |
| tree | ccd3bffee8bb0d866715216da196e1b69b676fb1 /src | |
| parent | c38b4bcee7c9e6913fdf95c1572a7d8125eab1a4 (diff) | |
| download | zig-7e47f106ccf73af4c890ecbb4d48e9e92d38d3c4.tar.gz zig-7e47f106ccf73af4c890ecbb4d48e9e92d38d3c4.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/value.zig | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/value.zig b/src/value.zig index 926a52c2b7..c7960741f6 100644 --- a/src/value.zig +++ b/src/value.zig @@ -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, } } |
