From 9e6e43984da7c9c382fbd47badb4808e6fae96d3 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 23 Jan 2006 17:51:43 -0200 Subject: [PATCH] details --- luaconf.h | 3 ++- lvm.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/luaconf.h b/luaconf.h index 3a588164..9c322807 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.77 2005/12/27 17:12:00 roberto Exp roberto $ +** $Id: luaconf.h,v 1.78 2006/01/13 19:36:28 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -488,6 +488,7 @@ ** =================================================================== */ +#define LUA_NUMBER_DOUBLE #define LUA_NUMBER double /* diff --git a/lvm.c b/lvm.c index 14902df9..834dd432 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.60 2005/12/22 16:19:56 roberto Exp roberto $ +** $Id: lvm.c,v 2.61 2006/01/10 12:50:00 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -95,7 +95,8 @@ static void callTMres (lua_State *L, StkId res, const TValue *f, -static void callTM (lua_State *L, const TValue *f, const TValue *p1, const TValue *p2, const TValue *p3) { +static void callTM (lua_State *L, const TValue *f, const TValue *p1, + const TValue *p2, const TValue *p3) { setobj2s(L, L->top, f); /* push function */ setobj2s(L, L->top+1, p1); /* 1st argument */ setobj2s(L, L->top+2, p2); /* 2nd argument */ @@ -649,7 +650,8 @@ void luaV_execute (lua_State *L, int nexeccalls) { lua_Number step = nvalue(ra+2); lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */ lua_Number limit = nvalue(ra+1); - if (step > 0 ? luai_numle(idx, limit) : luai_numle(limit, idx)) { + if (luai_numlt(0, step) ? luai_numle(idx, limit) + : luai_numle(limit, idx)) { dojump(L, pc, GETARG_sBx(i)); /* jump back */ setnvalue(ra, idx); /* update internal index... */ setnvalue(ra+3, idx); /* ...and external index */