}
ANN static m_bool _emit_stmt_auto(const Emitter emit, const Stmt_Auto stmt, m_uint *end_pc) {
- emit_push_scope(emit);
const Instr s1 = emit_add_instr(emit, MemSetImm);
Instr cpy = stmt->is_ptr ? emit_stmt_autoptr_init(emit, stmt->v->type) : NULL;
emit_local(emit, emit->gwion->type[et_int]);
end->m_val = emit_code_size(emit);
tgt->m_val = ini_pc;
s1->m_val = loop->m_val = offset;
- regpop(emit, SZ_INT);
- emit_pop_scope(emit);
return ret;
}
m_uint end_pc = 0;
const m_bool ret = _emit_stmt_auto(emit, stmt, &end_pc);
emit_pop_stack(emit, end_pc);
+ regpop(emit, SZ_INT);
return ret;
}
" This is not allowed in auto loop"), stmt->exp->info->type->name)
if(stmt->is_ptr) {
struct Type_List_ tl = {};
+ if(depth)
+ ptr = array_type(env, ptr, depth);
Type_Decl *td0 = type2td(env, ptr, stmt->exp->pos),
td = { .xid=insert_symbol("Ptr"), .types=&tl, .pos=stmt->exp->pos };
tl.td = td0;
ptr = known_type(env, &td);
- if(depth)
- ptr = array_type(env, ptr, depth);
td0->array = NULL;
free_type_decl(env->gwion->mp, td0);
const Type base = get_type(ptr);