~ubuntu-branches/ubuntu/utopic/lua5.1/utopic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/patch-lua-5.1.4-4.patch

  • Committer: Package Import Robot
  • Author(s): Enrico Tassi
  • Date: 2012-04-02 17:47:48 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20120402174748-uc90vbyeuwscswq6
Tags: 5.1.5-1
* New upstream release (Closes: #647518)
* Bump Standards-Version to 3.9.3 (no changes) 
* Fix paths of debug symbols setting debian/compat to 9 (Closes: #650104)
* Build-depend on debhelper >= 9
* Update debian/copyright yeas to 2012 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Author: The Lua team
2
 
Description: Fixes all known bugs of lua 5.1.4
3
 
Index: src/lcode.c
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
7
 
@@ -1,5 +1,5 @@
8
 
 /*
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
13
 
 */
14
 
@@ -544,10 +544,6 @@
15
 
       pc = NO_JUMP;  /* always true; do nothing */
16
 
       break;
17
 
     }
18
 
-    case VFALSE: {
19
 
-      pc = luaK_jump(fs);  /* always jump */
20
 
-      break;
21
 
-    }
22
 
     case VJMP: {
23
 
       invertjump(fs, e);
24
 
       pc = e->u.s.info;
25
 
@@ -572,10 +568,6 @@
26
 
       pc = NO_JUMP;  /* always false; do nothing */
27
 
       break;
28
 
     }
29
 
-    case VTRUE: {
30
 
-      pc = luaK_jump(fs);  /* always jump */
31
 
-      break;
32
 
-    }
33
 
     case VJMP: {
34
 
       pc = e->u.s.info;
35
 
       break;
36
 
Index: src/ldblib.c
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
40
 
@@ -1,5 +1,5 @@
41
 
 /*
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
46
 
 */
47
 
@@ -45,6 +45,7 @@
48
 
 
49
 
 
50
 
 static int db_getfenv (lua_State *L) {
51
 
+  luaL_checkany(L, 1);
52
 
   lua_getfenv(L, 1);
53
 
   return 1;
54
 
 }
55
 
Index: src/lgc.c
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
59
 
@@ -1,5 +1,5 @@
60
 
 /*
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 $
63
 
 ** Garbage Collector
64
 
 ** See Copyright Notice in lua.h
65
 
 */
66
 
@@ -627,7 +627,6 @@
67
 
     }
68
 
   }
69
 
   else {
70
 
-    lua_assert(g->totalbytes >= g->estimate);
71
 
     setthreshold(g);
72
 
   }
73
 
 }
74
 
Index: src/liolib.c
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
78
 
@@ -1,5 +1,5 @@
79
 
 /*
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
84
 
 */
85
 
@@ -276,7 +276,10 @@
86
 
     lua_pushnumber(L, d);
87
 
     return 1;
88
 
   }
89
 
-  else return 0;  /* read fails */
90
 
+  else {
91
 
+    lua_pushnil(L);  /* "result" to be removed */
92
 
+    return 0;  /* read fails */
93
 
+  }
94
 
 }
95
 
 
96
 
 
97
 
Index: src/llex.c
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
101
 
@@ -1,5 +1,5 @@
102
 
 /*
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 $
105
 
 ** Lexical Analyzer
106
 
 ** See Copyright Notice in lua.h
107
 
 */
108
 
@@ -118,8 +118,10 @@
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' */
112
 
-  if (ttisnil(o))
113
 
+  if (ttisnil(o)) {
114
 
     setbvalue(o, 1);  /* make sure `str' will not be collected */
115
 
+    luaC_checkGC(L);
116
 
+  }
117
 
   return ts;
118
 
 }
119
 
 
120
 
Index: src/loadlib.c
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
124
 
@@ -1,5 +1,5 @@
125
 
 /*
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
130
 
 **
131
 
@@ -639,7 +639,7 @@
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]);
140
 
Index: src/lparser.c
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
144
 
@@ -1,5 +1,5 @@
145
 
 /*
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 $
148
 
 ** Lua Parser
149
 
 ** See Copyright Notice in lua.h
150
 
 */
151
 
@@ -374,9 +374,9 @@
152
 
   lua_assert(luaG_checkcode(f));
153
 
   lua_assert(fs->bl == NULL);
154
 
   ls->fs = fs->prev;
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 */
159
 
 }
160
 
 
161
 
 
162
 
Index: src/lstrlib.c
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
166
 
@@ -1,5 +1,5 @@
167
 
 /*
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
172
 
 */
173
 
@@ -754,6 +754,7 @@
174
 
 
175
 
 
176
 
 static int str_format (lua_State *L) {
177
 
+  int top = lua_gettop(L);
178
 
   int arg = 1;
179
 
   size_t sfl;
180
 
   const char *strfrmt = luaL_checklstring(L, arg, &sfl);
181
 
@@ -768,7 +769,8 @@
182
 
     else { /* format item */
183
 
       char form[MAX_FORMAT];  /* to store the format (`%...') */
184
 
       char buff[MAX_ITEM];  /* to store the formatted item */
185
 
-      arg++;
186
 
+      if (++arg > top)
187
 
+        luaL_argerror(L, arg, "no value");
188
 
       strfrmt = scanformat(L, strfrmt, form);
189
 
       switch (*strfrmt++) {
190
 
         case 'c': {
191
 
Index: src/lvm.c
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
195
 
@@ -1,5 +1,5 @@
196
 
 /*
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
201
 
 */
202
 
@@ -133,6 +133,7 @@
203
 
 
204
 
 void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
205
 
   int loop;
206
 
+  TValue temp;
207
 
   for (loop = 0; loop < MAXTAGLOOP; loop++) {
208
 
     const TValue *tm;
209
 
     if (ttistable(t)) {  /* `t' is a table? */
210
 
@@ -141,6 +142,7 @@
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);
214
 
+        h->flags = 0;
215
 
         luaC_barriert(L, h, val);
216
 
         return;
217
 
       }
218
 
@@ -152,7 +154,9 @@
219
 
       callTM(L, tm, t, key, val);
220
 
       return;
221
 
     }
222
 
-    t = tm;  /* else repeat with `tm' */ 
223
 
+    /* else repeat with `tm' */
224
 
+    setobj(L, &temp, tm);  /* avoid pointing inside table (may rehash) */
225
 
+    t = &temp;
226
 
   }
227
 
   luaG_runerror(L, "loop in settable");
228
 
 }