diff options
| author | gingerBill <bill@gingerbill.org> | 2024-03-13 15:12:19 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-03-13 15:12:19 +0000 |
| commit | 4aec2de7bd186bbdfe9aa0f890f9a276480c80c2 (patch) | |
| tree | 7ace46f2786a6a823e12358d53988392593617cb /src | |
| parent | ac10f504e467053861fcf00b86bbb2904ddadafe (diff) | |
| parent | d62c92f5a9891267e6ee2c121085815ce6734cf6 (diff) | |
Merge branch 'master' of https://github.com/odin-lang/Odin
Diffstat (limited to 'src')
| -rw-r--r-- | src/check_expr.cpp | 4 | ||||
| -rw-r--r-- | src/path.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 0911e48cf..1e4c7499b 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -6796,7 +6796,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O isize index = lookup_polymorphic_record_parameter(original_type, name); if (index >= 0) { TypeTuple *params = get_record_polymorphic_params(original_type); - Entity *e = params->variables[i]; + Entity *e = params->variables[index]; if (e->kind == Entity_Constant) { check_expr_with_type_hint(c, &operands[i], fv->value, e->type); continue; @@ -6847,7 +6847,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O Array<Operand> ordered_operands = operands; if (!named_fields) { - ordered_operands = array_make<Operand>(permanent_allocator(), param_count); + ordered_operands = array_make<Operand>(permanent_allocator(), operands.count); array_copy(&ordered_operands, operands, 0); } else { TEMPORARY_ALLOCATOR_GUARD(); diff --git a/src/path.cpp b/src/path.cpp index 742bba7f8..b07f20870 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -407,7 +407,7 @@ gb_internal ReadDirectoryError read_directory(String path, Array<FileInfo> *fi) i64 size = dir_stat.st_size; FileInfo info = {}; - info.name = name; + info.name = copy_string(a, name); info.fullpath = path_to_full_path(a, filepath); info.size = size; array_add(fi, info); |