From b330329c29e416b292e394e41384454b61ea28ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 12 May 2020 21:42:43 +0200 Subject: [PATCH] :art: Improve VarargIni --- src/lib/vararg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/vararg.c b/src/lib/vararg.c index fbe0dc4a..74f6a567 100644 --- a/src/lib/vararg.c +++ b/src/lib/vararg.c @@ -62,6 +62,7 @@ static MFUN(mfun_vararg_cpy) { INSTR(VarargIni) { const M_Object o = new_object(shred->info->mp, shred, shred->info->vm->gwion->type[et_vararg]); struct Vararg_* arg = mp_calloc(shred->info->mp, Vararg); + *(struct Vararg_**)o->data = arg; POP_REG(shred, instr->m_val - SZ_INT) if((arg->l = instr->m_val)) { arg->d = (m_bit*)xmalloc(round2szint(arg->l)); @@ -79,9 +80,9 @@ INSTR(VarargIni) { offset += t->size; } arg->s = vector_size(kinds); - } - *(struct Vararg_**)o->data = arg; - *(M_Object*)REG(-SZ_INT) = o; + *(M_Object*)REG(-SZ_INT) = o; + } else + *(M_Object*)REG(-SZ_INT) = NULL; } static INSTR(VarargEnd) { -- 2.43.0