lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Em seg., 25 de mai. de 2020 às 20:56, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> escreveu:
> lvm.c (229)
> There is a possible division by zero.

Can you provide an example Lua program that shows this problem?
#include <stdio.h>

int main()
{
    int step = 0;
   
    step = ((unsigned int) -(step + 1)) + 1u;
    printf("step = %d", step);
   
    return 0;
}
step = 0

lvm.c (226)
else {  /* step < 0; descending loop */

var step here can be equal zero.

regards,
Ranier Vilela