diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-04-26 13:06:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-04-26 13:06:53 -0300 |
commit | f79584facab6a11cd036b5f12dbfa80460eee146 (patch) | |
tree | bb4842a7bcba4598ea049db3a99c1bfa003e55dc /lvm.c | |
parent | 4abe99dc341b2ec0cb59b8fa95006e9781938eed (diff) | |
download | lua-f79584facab6a11cd036b5f12dbfa80460eee146.tar.gz lua-f79584facab6a11cd036b5f12dbfa80460eee146.tar.bz2 lua-f79584facab6a11cd036b5f12dbfa80460eee146.zip |
detail
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.163 2013/04/26 13:07:53 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.164 2013/04/26 16:03:50 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -842,14 +842,14 @@ void luaV_execute (lua_State *L) { | |||
842 | } | 842 | } |
843 | else { /* try with floats */ | 843 | else { /* try with floats */ |
844 | lua_Number ninit; lua_Number nlimit; lua_Number nstep; | 844 | lua_Number ninit; lua_Number nlimit; lua_Number nstep; |
845 | if (!tonumber(init, &ninit)) | ||
846 | luaG_runerror(L, LUA_QL("for") " initial value must be a number"); | ||
847 | if (!tonumber(plimit, &nlimit)) | 845 | if (!tonumber(plimit, &nlimit)) |
848 | luaG_runerror(L, LUA_QL("for") " limit must be a number"); | 846 | luaG_runerror(L, LUA_QL("for") " limit must be a number"); |
849 | setnvalue(plimit, nlimit); | 847 | setnvalue(plimit, nlimit); |
850 | if (!tonumber(pstep, &nstep)) | 848 | if (!tonumber(pstep, &nstep)) |
851 | luaG_runerror(L, LUA_QL("for") " step must be a number"); | 849 | luaG_runerror(L, LUA_QL("for") " step must be a number"); |
852 | setnvalue(pstep, nstep); | 850 | setnvalue(pstep, nstep); |
851 | if (!tonumber(init, &ninit)) | ||
852 | luaG_runerror(L, LUA_QL("for") " initial value must be a number"); | ||
853 | setnvalue(ra, luai_numsub(L, ninit, nstep)); | 853 | setnvalue(ra, luai_numsub(L, ninit, nstep)); |
854 | } | 854 | } |
855 | ci->u.l.savedpc += GETARG_sBx(i); | 855 | ci->u.l.savedpc += GETARG_sBx(i); |