lua-users home
lua-l archive

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


The following function ran fine with JIT off (-joff) for both LuaJIT
2.0 beta 8 and 9, but got erroneous results with JIT on. Is this a
known bug?

(1) with -joff

    > function fib(n) return (n < 2) and 1 or fib(n-1)+fib(n-2) end
    > = fib(10)
    89
    > =fib(20)
    10946

(2) without -joff

    > function fib(n) return (n < 2) and 1 or fib(n-1)+fib(n-2) end
    > = fib(10)
    79
    > = fib(20)
    stdin:1: attempt to perform arithmetic on a nil value