value: properly hash null_value pointer

Closes #13325
This commit is contained in:
Veikka Tuominen 2022-10-28 00:07:38 +03:00
parent c3b85e4e2f
commit 6fc71835c3
2 changed files with 10 additions and 0 deletions

View File

@ -2621,6 +2621,7 @@ pub const Value = extern union {
.zero,
.one,
.null_value,
.int_u64,
.int_i64,
.int_big_positive,

View File

@ -396,3 +396,12 @@ test "slice as parameter type" {
try expect(S.internComptimeString(source_a[1..2]) == S.internComptimeString(source_a[1..2]));
try expect(S.internComptimeString(source_a[2..4]) != S.internComptimeString(source_a[5..7]));
}
test "null sentinel pointer passed as generic argument" {
const S = struct {
fn doTheTest(a: anytype) !void {
try std.testing.expect(@ptrToInt(a) == 8);
}
};
try S.doTheTest((@intToPtr([*:null]const [*c]const u8, 8)));
}