From 79d2c30999068ebe50aa322bbb6a5eaca5c4e3cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Wed, 11 May 2022 20:33:53 +0200 Subject: [PATCH] :bug: Abort compilation on locale error --- src/emit/emit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index fcf0a2ad..ce61d198 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -931,8 +931,10 @@ ANN static m_bool emit_prim_locale(const Emitter emit, const Symbol *id) { shred->info->me->ref++; vm_run(emit->gwion->vm); emit->gwion->vm->bbq->is_running = true; + const m_float ret = *(m_float*)shred->reg; + if(ret == -1.0) return GW_ERROR; const Instr instr = emit_add_instr(emit, RegPushImm2); - instr->f = *(m_float*)shred->reg; + instr->f = ret; return GW_OK; } -- 2.43.0