mirror of
https://github.com/ziglang/zig.git
synced 2025-12-31 18:43:18 +00:00
value: account for undef value for ptr in slice in hashUncoerced
This commit is contained in:
parent
3fa226a80c
commit
114244f770
@ -2581,7 +2581,12 @@ pub const Value = extern union {
|
||||
},
|
||||
.Float, .ComptimeFloat => std.hash.autoHash(hasher, @bitCast(u128, val.toFloat(f128))),
|
||||
.Bool, .Int, .ComptimeInt, .Pointer, .Fn => switch (val.tag()) {
|
||||
.slice => val.castTag(.slice).?.data.ptr.hashPtr(hasher, mod.getTarget()),
|
||||
.slice => {
|
||||
const slice = val.castTag(.slice).?.data;
|
||||
var ptr_buf: Type.SlicePtrFieldTypeBuffer = undefined;
|
||||
const ptr_ty = ty.slicePtrFieldType(&ptr_buf);
|
||||
slice.ptr.hashUncoerced(ptr_ty, hasher, mod);
|
||||
},
|
||||
else => val.hashPtr(hasher, mod.getTarget()),
|
||||
},
|
||||
.Array, .Vector => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user