diff --git a/core/mem/mem.odin b/core/mem/mem.odin index f06428cea..b02d3ef61 100644 --- a/core/mem/mem.odin +++ b/core/mem/mem.odin @@ -27,6 +27,9 @@ set :: proc "contextless" (data: rawptr, value: byte, len: int) -> rawptr { zero :: proc "contextless" (data: rawptr, len: int) -> rawptr { return set(data, 0, len); } +zero_item :: proc "contextless" (item: $P/^$T) { + set(item, 0, size_of(T)); +} zero_slice :: proc "contextless" (data: $T/[]$E) { if n := len(data); n > 0 { zero(&data[0], size_of(E)*n); diff --git a/src/check_type.cpp b/src/check_type.cpp index eb1496bdc..7324e92ca 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -1327,7 +1327,7 @@ ParameterValue handle_parameter_value(CheckerContext *ctx, Type *in_type, Type * } if (in_type) { - check_is_assignable_to(ctx, &o, in_type); + check_assignment(ctx, &o, in_type, str_lit("parameter value")); } if (out_type_) *out_type_ = default_type(o.type); diff --git a/src/types.cpp b/src/types.cpp index 839c237c5..e6010b1e5 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1042,7 +1042,7 @@ bool is_type_integer_endian_big(Type *t) { } else if (t->kind == Type_BitSet) { return is_type_integer_endian_big(bit_set_to_int(t)); } else { - GB_PANIC("Unsupported type: %s", type_to_string); + GB_PANIC("Unsupported type: %s", type_to_string(t)); } return build_context.endian_kind == TargetEndian_Big; } @@ -1059,7 +1059,7 @@ bool is_type_integer_endian_little(Type *t) { } else if (t->kind == Type_BitSet) { return is_type_integer_endian_little(bit_set_to_int(t)); } else { - GB_PANIC("Unsupported type: %s", type_to_string); + GB_PANIC("Unsupported type: %s", type_to_string(t)); } return build_context.endian_kind == TargetEndian_Little; }