Ver código fonte

Print error in case of non-integer in arithmetic operation

pull/5/head
mtardy 4 anos atrás
pai
commit
2128d6abf9
1 arquivos alterados com 4 adições e 0 exclusões
  1. +4
    -0
      object.c

+ 4
- 0
object.c Ver arquivo

@ -177,6 +177,10 @@ void println(oop ast);
int getInteger(oop obj)
{
if (!isInteger(obj)) {
fprintf(stderr, "\nNon-integer in arithmetic expression\n");
exit(1);
}
#if (USE_TAG)
return (intptr_t)obj >> 1;
#else

Carregando…
Cancelar
Salvar