lua-users home
lua-l archive

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


An easy way to support -0 is to avoid the optimization when the value is
zero. I guess the fix would be simply the following:

lcode.c:579:
-   if (e->k == VK && ttisnumber(&fs->f->k[e->info]))
+   if (e->k == VK && ttisnumber(&fs->f->k[e->info]) &&
+                     nvalue(&fs->f->k[e->info]) != 0)

(Untested code for Lua 5.0.2)

The question is whether we really should care about those details...

-- Roberto