mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 14:18:47 +00:00
Fix push_allocator
This commit is contained in:
+3
-1
@@ -1073,6 +1073,7 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
|
|||||||
goto skip_expr;
|
goto skip_expr;
|
||||||
}
|
}
|
||||||
} else if (operand.mode != Addressing_Invalid) {
|
} else if (operand.mode != Addressing_Invalid) {
|
||||||
|
bool is_ptr = is_type_pointer(operand.type);
|
||||||
Type *t = base_type(type_deref(operand.type));
|
Type *t = base_type(type_deref(operand.type));
|
||||||
switch (t->kind) {
|
switch (t->kind) {
|
||||||
case Type_Basic:
|
case Type_Basic:
|
||||||
@@ -1138,7 +1139,8 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
|
|||||||
found = current_scope_lookup_entity(c->context.scope, str);
|
found = current_scope_lookup_entity(c->context.scope, str);
|
||||||
}
|
}
|
||||||
if (found == nullptr) {
|
if (found == nullptr) {
|
||||||
entity = make_entity_variable(c->allocator, c->context.scope, token, type, true);
|
bool is_immutable = true;
|
||||||
|
entity = make_entity_variable(c->allocator, c->context.scope, token, type, is_immutable);
|
||||||
add_entity_definition(&c->info, name, entity);
|
add_entity_definition(&c->info, name, entity);
|
||||||
} else {
|
} else {
|
||||||
TokenPos pos = found->token.pos;
|
TokenPos pos = found->token.pos;
|
||||||
|
|||||||
+3
-1
@@ -7065,7 +7065,9 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) {
|
|||||||
array_add(&proc->context_stack, next);
|
array_add(&proc->context_stack, next);
|
||||||
defer (array_pop(&proc->context_stack));
|
defer (array_pop(&proc->context_stack));
|
||||||
|
|
||||||
irValue *gep = ir_emit_struct_ep(proc, next, 1);
|
// TODO(bill): is this too leaky?
|
||||||
|
Selection sel = lookup_field(proc->module->allocator, t_context, str_lit("allocator"), false);
|
||||||
|
irValue *gep = ir_emit_deep_field_gep(proc, next, sel);
|
||||||
ir_emit_store(proc, gep, ir_build_expr(proc, pa->expr));
|
ir_emit_store(proc, gep, ir_build_expr(proc, pa->expr));
|
||||||
|
|
||||||
ir_build_stmt(proc, pa->body);
|
ir_build_stmt(proc, pa->body);
|
||||||
|
|||||||
Reference in New Issue
Block a user