]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Abort compilation on locale error
authorJérémie Astor <fennecdjay@gmail.com>
Wed, 11 May 2022 18:33:53 +0000 (20:33 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Wed, 11 May 2022 18:33:53 +0000 (20:33 +0200)
src/emit/emit.c

index fcf0a2ad7b3bbf1010aca14fc9f8c115a5b4ea58..ce61d19822f1633524122b1d28cf9792d3f38d50 100644 (file)
@@ -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;
 }