diff options
| author | Kevin Watters <kevinwatters@gmail.com> | 2019-03-31 12:03:22 -0400 |
|---|---|---|
| committer | Kevin Watters <kevinwatters@gmail.com> | 2019-03-31 12:03:22 -0400 |
| commit | 381fbd3dafed820583c97f176d2694b21358d178 (patch) | |
| tree | 071c9b572b655ca2ca5597a7252eebe228670a02 /src/ir.cpp | |
| parent | 76a2807b56a9c0a40c66915d5b77cf537ad376f2 (diff) | |
| parent | dd9113786c4e7b18e894bd3ceee94cdf08ac6037 (diff) | |
Merge branch 'master' of github.com:odin-lang/Odin
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index b5ff56b93..b486a6309 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -1433,11 +1433,13 @@ irValue *ir_value_procedure(irModule *m, Entity *entity, Type *type, Ast *type_e irValue *ir_generate_array(irModule *m, Type *elem_type, i64 count, String prefix, i64 id) { gbAllocator a = ir_allocator(); Token token = {Token_Ident}; - isize name_len = prefix.len + 10; + isize name_len = prefix.len + 1 + 20; - char *text = gb_alloc_array(a, char, name_len); + auto suffix_id = cast(unsigned long long)id; + char *text = gb_alloc_array(a, char, name_len+1); gb_snprintf(text, name_len, - "%.*s-%llx", LIT(prefix), cast(unsigned long long)id); + "%.*s-%llu", LIT(prefix), suffix_id); + text[name_len] = 0; String s = make_string_c(text); |