aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-03-28 12:03:58 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-03-28 12:05:08 -0700
commit7e47f106ccf73af4c890ecbb4d48e9e92d38d3c4 (patch)
treeccd3bffee8bb0d866715216da196e1b69b676fb1 /src
parentc38b4bcee7c9e6913fdf95c1572a7d8125eab1a4 (diff)
downloadzig-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.zig8
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,
}
}