mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Fix #location for anonymous procedures
This commit is contained in:
+9
-3
@@ -200,9 +200,10 @@ proc make_source_code_location(file: string, line, column: i64, procedure: strin
|
|||||||
const DEFAULT_ALIGNMENT = align_of([vector 4]f32);
|
const DEFAULT_ALIGNMENT = align_of([vector 4]f32);
|
||||||
|
|
||||||
|
|
||||||
proc __check_context() {
|
proc __init_context(c: ^Context) {
|
||||||
var c = &__context;
|
if c == nil {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if c.allocator.procedure == nil {
|
if c.allocator.procedure == nil {
|
||||||
c.allocator = default_allocator();
|
c.allocator = default_allocator();
|
||||||
}
|
}
|
||||||
@@ -211,6 +212,11 @@ proc __check_context() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc __check_context() {
|
||||||
|
__init_context(&__context);
|
||||||
|
}
|
||||||
|
|
||||||
proc alloc(size: int, alignment: int = DEFAULT_ALIGNMENT) -> rawptr #inline {
|
proc alloc(size: int, alignment: int = DEFAULT_ALIGNMENT) -> rawptr #inline {
|
||||||
__check_context();
|
__check_context();
|
||||||
var a = context.allocator;
|
var a = context.allocator;
|
||||||
|
|||||||
+5
-2
@@ -3677,7 +3677,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv
|
|||||||
Entity *e = entity_of_ident(proc->module->info, ident);
|
Entity *e = entity_of_ident(proc->module->info, ident);
|
||||||
GB_ASSERT(e != NULL);
|
GB_ASSERT(e != NULL);
|
||||||
|
|
||||||
if (e->parent_proc_decl != NULL) {
|
if (e->parent_proc_decl != NULL && e->parent_proc_decl->entity_count > 0) {
|
||||||
procedure = e->parent_proc_decl->entities[0]->token.string;
|
procedure = e->parent_proc_decl->entities[0]->token.string;
|
||||||
} else {
|
} else {
|
||||||
procedure = str_lit("");
|
procedure = str_lit("");
|
||||||
@@ -4665,7 +4665,10 @@ irValue *ir_build_expr(irProcedure *proc, AstNode *expr) {
|
|||||||
TypeTuple *pt = &type->params->Tuple;
|
TypeTuple *pt = &type->params->Tuple;
|
||||||
|
|
||||||
if (arg_count < type->param_count) {
|
if (arg_count < type->param_count) {
|
||||||
String procedure = proc->entity->token.string;
|
String procedure = {};
|
||||||
|
if (proc->entity != NULL) {
|
||||||
|
procedure = proc->entity->token.string;
|
||||||
|
}
|
||||||
TokenPos pos = ast_node_token(ce->proc).pos;
|
TokenPos pos = ast_node_token(ce->proc).pos;
|
||||||
|
|
||||||
isize end = type->param_count;
|
isize end = type->param_count;
|
||||||
|
|||||||
Reference in New Issue
Block a user