mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-30 19:30:06 +00:00
Fix lb_add_global_generated_with_name
This commit is contained in:
@@ -2790,8 +2790,9 @@ gb_internal lbAddr lb_add_global_generated_with_name(lbModule *m, Type *type, lb
|
|||||||
GB_ASSERT(type != nullptr);
|
GB_ASSERT(type != nullptr);
|
||||||
type = default_type(type);
|
type = default_type(type);
|
||||||
|
|
||||||
isize max_len = 7+8+1;
|
u8 *str = cast(u8 *)gb_alloc_array(temporary_allocator(), u8, name.len);
|
||||||
u8 *str = cast(u8 *)gb_alloc_array(permanent_allocator(), u8, max_len);
|
memcpy(str, name.text, name.len);
|
||||||
|
str[name.len] = 0;
|
||||||
|
|
||||||
Scope *scope = nullptr;
|
Scope *scope = nullptr;
|
||||||
Entity *e = alloc_entity_variable(scope, make_token_ident(name), type);
|
Entity *e = alloc_entity_variable(scope, make_token_ident(name), type);
|
||||||
|
|||||||
Reference in New Issue
Block a user