mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
fixed issues with uninitialized contexts
also, `any_to_bytes` I think, and maybe some bindings in `core:sys/windows.odin`
This commit is contained in:
@@ -1650,6 +1650,12 @@ irValue *ir_find_or_generate_context_ptr(irProcedure *proc) {
|
|||||||
if (proc->context_stack.count > 0) {
|
if (proc->context_stack.count > 0) {
|
||||||
return proc->context_stack[proc->context_stack.count-1];
|
return proc->context_stack[proc->context_stack.count-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
irBlock *tmp_block = proc->curr_block;
|
||||||
|
proc->curr_block = proc->blocks[0];
|
||||||
|
|
||||||
|
defer (proc->curr_block = tmp_block);
|
||||||
|
|
||||||
irValue *c = ir_add_local_generated(proc, t_context);
|
irValue *c = ir_add_local_generated(proc, t_context);
|
||||||
array_add(&proc->context_stack, c);
|
array_add(&proc->context_stack, c);
|
||||||
ir_emit_store(proc, c, ir_emit_load(proc, proc->module->global_default_context));
|
ir_emit_store(proc, c, ir_emit_load(proc, proc->module->global_default_context));
|
||||||
|
|||||||
Reference in New Issue
Block a user