return GW_OK;
}
+ANN static Instr variadic_state0(const Emitter emit, const Stmt_VarLoop stmt) {
+ CHECK_BO(emit_exp(emit, stmt->exp))
+ return emit_add_instr(emit, BranchEqInt);
+}
+
ANN static m_bool variadic_state(const Emitter emit, const Stmt_VarLoop stmt, const m_uint status) {
regpushi(emit, status);
CHECK_BB(emit_exp(emit, stmt->exp))
}
ANN static m_bool emit_stmt_varloop(const Emitter emit, const Stmt_VarLoop stmt) {
+ DECL_OB(const Instr,state, = variadic_state0(emit, stmt))
CHECK_BB(variadic_state(emit, stmt, 1))
CHECK_BB(emit_exp(emit, stmt->exp))
const Instr instr = emit_add_instr(emit, BranchEqInt);
emit_vararg_end(emit, pc);
instr->m_val = emit_code_size(emit);
CHECK_BB(variadic_state(emit, stmt, 0))
+ state->m_val = instr->m_val = emit_code_size(emit);
return GW_OK;
}
struct Vararg_ *arg = *(struct Vararg_**)o->data;
m_uint offset = 0;
for(m_uint i = 0; i < vector_size(&arg->t); ++i) {
- const Type t = (Type)vector_at(&arg->t, arg->i);
- *(m_uint*)(arg->d + offset) = *(m_uint*)(shred->reg - SZ_INT + offset);
+ const Type t = (Type)vector_at(&arg->t, i);
if(isa(t, shred->info->vm->gwion->type[et_object]) > 0)
release(*(M_Object*)(arg->d + offset), shred);
offset += t->size;