mirror of
https://github.com/ziglang/zig.git
synced 2026-01-05 04:53:17 +00:00
stage2: fix hash/eql on function types
to account for generic callconv and generic alignment.
This commit is contained in:
parent
56608cbb3d
commit
282437c753
20
src/type.zig
20
src/type.zig
@ -640,18 +640,18 @@ pub const Type = extern union {
|
||||
if (!eql(a_info.return_type, b_info.return_type, mod))
|
||||
return false;
|
||||
|
||||
if (a_info.cc != b_info.cc)
|
||||
return false;
|
||||
|
||||
if (a_info.alignment != b_info.alignment)
|
||||
return false;
|
||||
|
||||
if (a_info.is_var_args != b_info.is_var_args)
|
||||
return false;
|
||||
|
||||
if (a_info.is_generic != b_info.is_generic)
|
||||
return false;
|
||||
|
||||
if (!a_info.cc_is_generic and a_info.cc != b_info.cc)
|
||||
return false;
|
||||
|
||||
if (!a_info.align_is_generic and a_info.alignment != b_info.alignment)
|
||||
return false;
|
||||
|
||||
if (a_info.param_types.len != b_info.param_types.len)
|
||||
return false;
|
||||
|
||||
@ -1039,8 +1039,12 @@ pub const Type = extern union {
|
||||
if (fn_info.return_type.tag() != .generic_poison) {
|
||||
hashWithHasher(fn_info.return_type, hasher, mod);
|
||||
}
|
||||
std.hash.autoHash(hasher, fn_info.alignment);
|
||||
std.hash.autoHash(hasher, fn_info.cc);
|
||||
if (!fn_info.align_is_generic) {
|
||||
std.hash.autoHash(hasher, fn_info.alignment);
|
||||
}
|
||||
if (!fn_info.cc_is_generic) {
|
||||
std.hash.autoHash(hasher, fn_info.cc);
|
||||
}
|
||||
std.hash.autoHash(hasher, fn_info.is_var_args);
|
||||
std.hash.autoHash(hasher, fn_info.is_generic);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user