lua-users home
lua-l archive

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


Hi,

I am testing a merge of Lua 5.3.3 into Ravi and am facing a strange
issue which I have not yet been able to debug.

When I run the Lua tests (_port=1) and enable lua_assert() in the
code, the following assertion in lcode.c fails when compiling
math.lua.

static void freereg (FuncState *fs, int reg) {
  if (!ISK(reg) && reg >= fs->nactvar) {
    fs->freereg--;
    lua_assert(reg == fs->freereg);
  }
}

The assertion failure occurs when compiling math.lua at line 551:

 assert(1 % math.huge == 1)

If I comment out this line then the tests pass.

I have tried running this line standalone and it doesn't cause a failure.

Obviously I have a modified version of the Lua code and it is likely
that I have made a mistake somewhere while merging but having scanned
through the changes several times I cannot locate the bug.

I have not yet tried to run the Lua tests using unchanged 5.3.3 code -
I will check that as well.

Any pointers as to what I should look for? I realize it is impossible
to comment on modified code base but I thought I shall ask just in
case there was something obvious I need to check.

BTW in the same math.lua script I was puzzled to see that the isNaN
function always returns true. Is that intentional?

Thanks and Regards
Dibyendu