2
Description: Fixes all known bugs of lua 5.1.4
4
===================================================================
5
--- old/src/lcode.c 2007-12-28 16:32:23.000000000 +0100
6
+++ new/src/lcode.c 2011-12-24 15:59:53.000000000 +0100
9
-** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
10
+** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $
11
** Code generator for Lua
12
** See Copyright Notice in lua.h
15
pc = NO_JUMP; /* always true; do nothing */
19
- pc = luaK_jump(fs); /* always jump */
26
pc = NO_JUMP; /* always false; do nothing */
30
- pc = luaK_jump(fs); /* always jump */
37
===================================================================
38
--- old/src/ldblib.c 2008-01-21 14:11:21.000000000 +0100
39
+++ new/src/ldblib.c 2011-12-24 15:59:53.000000000 +0100
42
-** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
43
+** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $
44
** Interface from Lua to its debug API
45
** See Copyright Notice in lua.h
50
static int db_getfenv (lua_State *L) {
51
+ luaL_checkany(L, 1);
56
===================================================================
57
--- old/src/lgc.c 2007-12-27 14:02:25.000000000 +0100
58
+++ new/src/lgc.c 2011-12-24 15:59:53.000000000 +0100
61
-** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $
62
+** $Id: lgc.c,v 2.38.1.2 2011/03/18 18:05:38 roberto Exp $
64
** See Copyright Notice in lua.h
70
- lua_assert(g->totalbytes >= g->estimate);
75
===================================================================
76
--- old/src/liolib.c 2008-01-18 18:47:43.000000000 +0100
77
+++ new/src/liolib.c 2011-12-24 15:59:53.000000000 +0100
80
-** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
81
+** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $
82
** Standard I/O (and system) library
83
** See Copyright Notice in lua.h
89
- else return 0; /* read fails */
91
+ lua_pushnil(L); /* "result" to be removed */
92
+ return 0; /* read fails */
98
===================================================================
99
--- old/src/llex.c 2007-12-27 14:02:25.000000000 +0100
100
+++ new/src/llex.c 2011-12-24 15:59:53.000000000 +0100
103
-** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
104
+** $Id: llex.c,v 2.20.1.2 2009/11/23 14:58:22 roberto Exp $
106
** See Copyright Notice in lua.h
109
lua_State *L = ls->L;
110
TString *ts = luaS_newlstr(L, str, l);
111
TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
114
setbvalue(o, 1); /* make sure `str' will not be collected */
121
===================================================================
122
--- old/src/loadlib.c 2008-08-06 15:29:28.000000000 +0200
123
+++ new/src/loadlib.c 2011-12-24 15:59:53.000000000 +0100
126
-** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $
127
+** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $
128
** Dynamic library loader for Lua
129
** See Copyright Notice in lua.h
132
lua_pushvalue(L, -1);
133
lua_replace(L, LUA_ENVIRONINDEX);
134
/* create `loaders' table */
135
- lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1);
136
+ lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);
137
/* fill it with pre-defined loaders */
138
for (i=0; loaders[i] != NULL; i++) {
139
lua_pushcfunction(L, loaders[i]);
141
===================================================================
142
--- old/src/lparser.c 2007-12-28 16:32:23.000000000 +0100
143
+++ new/src/lparser.c 2011-12-24 15:59:54.000000000 +0100
146
-** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $
147
+** $Id: lparser.c,v 2.42.1.4 2011/10/21 19:31:42 roberto Exp $
149
** See Copyright Notice in lua.h
152
lua_assert(luaG_checkcode(f));
153
lua_assert(fs->bl == NULL);
155
- L->top -= 2; /* remove table and prototype from the stack */
156
/* last token read was anchored in defunct function; must reanchor it */
157
if (fs) anchor_token(ls);
158
+ L->top -= 2; /* remove table and prototype from the stack */
163
===================================================================
164
--- old/src/lstrlib.c 2008-07-11 19:27:21.000000000 +0200
165
+++ new/src/lstrlib.c 2011-12-24 15:59:54.000000000 +0100
168
-** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
169
+** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $
170
** Standard library for string operations and pattern-matching
171
** See Copyright Notice in lua.h
176
static int str_format (lua_State *L) {
177
+ int top = lua_gettop(L);
180
const char *strfrmt = luaL_checklstring(L, arg, &sfl);
182
else { /* format item */
183
char form[MAX_FORMAT]; /* to store the format (`%...') */
184
char buff[MAX_ITEM]; /* to store the formatted item */
187
+ luaL_argerror(L, arg, "no value");
188
strfrmt = scanformat(L, strfrmt, form);
189
switch (*strfrmt++) {
192
===================================================================
193
--- old/src/lvm.c 2007-12-28 16:32:23.000000000 +0100
194
+++ new/src/lvm.c 2011-12-24 15:59:54.000000000 +0100
197
-** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
198
+** $Id: lvm.c,v 2.63.1.5 2011/08/17 20:43:11 roberto Exp $
199
** Lua virtual machine
200
** See Copyright Notice in lua.h
204
void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
207
for (loop = 0; loop < MAXTAGLOOP; loop++) {
209
if (ttistable(t)) { /* `t' is a table? */
211
if (!ttisnil(oldval) || /* result is no nil? */
212
(tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
213
setobj2t(L, oldval, val);
215
luaC_barriert(L, h, val);
219
callTM(L, tm, t, key, val);
222
- t = tm; /* else repeat with `tm' */
223
+ /* else repeat with `tm' */
224
+ setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
227
luaG_runerror(L, "loop in settable");