diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-03-27 21:05:42 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-03-27 22:38:37 +0300 |
| commit | 7217148edf28a0d3ab69b8c36b13d29c023e12fd (patch) | |
| tree | 082c659c0fd97bfa274baa507399d066f83c56a5 /src | |
| parent | bda7993bebf6c13d1c4f98269c80a2463f99e659 (diff) | |
| download | zig-7217148edf28a0d3ab69b8c36b13d29c023e12fd.tar.gz zig-7217148edf28a0d3ab69b8c36b13d29c023e12fd.zip | |
Value: hash lazy_align
Diffstat (limited to 'src')
| -rw-r--r-- | src/value.zig | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/value.zig b/src/value.zig index 0467f0362c..926a52c2b7 100644 --- a/src/value.zig +++ b/src/value.zig @@ -461,7 +461,7 @@ pub const Value = extern union { => unreachable, .ty, .lazy_align => { - const payload = self.castTag(.ty).?; + const payload = self.cast(Payload.Ty).?; const new_payload = try arena.create(Payload.Ty); new_payload.* = .{ .base = payload.base, @@ -718,7 +718,7 @@ pub const Value = extern union { .lazy_align => { try out_stream.writeAll("@alignOf("); try val.castTag(.lazy_align).?.data.dump("", options, out_stream); - try out_stream.writeAll(")"); + return try out_stream.writeAll(")"); }, .int_type => { const int_type = val.castTag(.int_type).?.data; @@ -2478,6 +2478,13 @@ pub const Value = extern union { .the_only_possible_value, => 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, } } |
