From: Jérémie Astor Date: Wed, 6 May 2020 22:51:19 +0000 (+0200) Subject: :bug: Fix vararg in case of null X-Git-Tag: nightly~1643 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=2dd7b6e57255acf7ecbfbe4ee343ea57502979cb;p=gwion.git :bug: Fix vararg in case of null --- diff --git a/src/lib/vararg.c b/src/lib/vararg.c index b5128c27..9d357c00 100644 --- a/src/lib/vararg.c +++ b/src/lib/vararg.c @@ -67,8 +67,11 @@ INSTR(VarargIni) { 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); - if(isa(t, shred->info->vm->gwion->type[et_object]) > 0) - ++(*(M_Object*)(arg->d + offset))->ref; + if(isa(t, shred->info->vm->gwion->type[et_object]) > 0) { + const M_Object obj = *(M_Object*)(arg->d + offset); + if(obj) + ++obj->ref; + } offset += t->size; } arg->s = vector_size(kinds);