From: fennecdjay Date: Sat, 8 Jun 2019 09:27:16 +0000 (+0200) Subject: :art: Variadic security X-Git-Tag: nightly~2443^2~13 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ae32384a1544a332a26580489476e30f8977f1f2;p=gwion.git :art: Variadic security --- diff --git a/src/emit/emit.c b/src/emit/emit.c index 6683d9e7..6f7d6aac 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1570,6 +1570,10 @@ ANN static m_bool emit_vararg(const Emitter emit, const Exp_Dot* member) { emit_vararg_end(emit, offset); return GW_OK; } + if(!get_variadic(emit)) + ERR_B(exp_self(member)->pos, "vararg.%s used before vararg.start. this is an error", s_name(member->xid)) + if(GET_FLAG(emit->env->func, empty)) + ERR_B(exp_self(member)->pos, "vararg.%s used after vararg.end. this is an error", s_name(member->xid)) const Instr instr = emit_add_instr(emit, VarargMember); instr->m_val = offset; instr->m_val2 = exp_self(member)->type->size;