Skip to content

Commit 2f443ec

Browse files
committed
Updated Lua to 5.1.5-2
1 parent b8d0f7b commit 2f443ec

File tree

9 files changed

+20
-27
lines changed

9 files changed

+20
-27
lines changed

src/lbaselib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ static void base_open (lua_State *L) {
630630
luaL_register(L, "_G", base_funcs);
631631
lua_pushliteral(L, LUA_VERSION);
632632
lua_setglobal(L, "_VERSION"); /* set global _VERSION */
633-
/* `ipairs' and `pairs' need auxliliary functions as upvalues */
633+
/* `ipairs' and `pairs' need auxiliary functions as upvalues */
634634
auxopen(L, "ipairs", luaB_ipairs, ipairsaux);
635635
auxopen(L, "pairs", luaB_pairs, luaB_next);
636636
/* `newproxy' needs a weaktable as upvalue */

src/lcode.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: lcode.c,v 2.25.1.4 2009/06/15 14:12:25 roberto Exp $
2+
** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $
33
** Code generator for Lua
44
** See Copyright Notice in lua.h
55
*/
@@ -549,13 +549,6 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) {
549549
pc = e->u.s.info;
550550
break;
551551
}
552-
case VFALSE: {
553-
if (!hasjumps(e)) {
554-
pc = luaK_jump(fs); /* always jump */
555-
break;
556-
}
557-
/* else go through */
558-
}
559552
default: {
560553
pc = jumponcond(fs, e, 0);
561554
break;
@@ -579,13 +572,6 @@ static void luaK_goiffalse (FuncState *fs, expdesc *e) {
579572
pc = e->u.s.info;
580573
break;
581574
}
582-
case VTRUE: {
583-
if (!hasjumps(e)) {
584-
pc = luaK_jump(fs); /* always jump */
585-
break;
586-
}
587-
/* else go through */
588-
}
589575
default: {
590576
pc = jumponcond(fs, e, 1);
591577
break;

src/ldo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $
2+
** $Id: ldo.c,v 2.38.1.4 2012/01/18 02:27:10 roberto Exp $
33
** Stack and Call structure of Lua
44
** See Copyright Notice in lua.h
55
*/
@@ -228,6 +228,7 @@ static StkId adjust_varargs (lua_State *L, Proto *p, int actual) {
228228
int nvar = actual - nfixargs; /* number of extra arguments */
229229
lua_assert(p->is_vararg & VARARG_HASARG);
230230
luaC_checkGC(L);
231+
luaD_checkstack(L, p->maxstacksize);
231232
htab = luaH_new(L, nvar, 1); /* create `arg' table */
232233
for (i=0; i<nvar; i++) /* put extra arguments into `arg' table */
233234
setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i);

src/lgc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $
2+
** $Id: lgc.c,v 2.38.1.2 2011/03/18 18:05:38 roberto Exp $
33
** Garbage Collector
44
** See Copyright Notice in lua.h
55
*/
@@ -627,7 +627,6 @@ void luaC_step (lua_State *L) {
627627
}
628628
}
629629
else {
630-
lua_assert(g->totalbytes >= g->estimate);
631630
setthreshold(g);
632631
}
633632
}

src/lparser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $
2+
** $Id: lparser.c,v 2.42.1.4 2011/10/21 19:31:42 roberto Exp $
33
** Lua Parser
44
** See Copyright Notice in lua.h
55
*/
@@ -374,9 +374,9 @@ static void close_func (LexState *ls) {
374374
lua_assert(luaG_checkcode(f));
375375
lua_assert(fs->bl == NULL);
376376
ls->fs = fs->prev;
377-
L->top -= 2; /* remove table and prototype from the stack */
378377
/* last token read was anchored in defunct function; must reanchor it */
379378
if (fs) anchor_token(ls);
379+
L->top -= 2; /* remove table and prototype from the stack */
380380
}
381381

382382

src/lua.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $
2+
** $Id: lua.h,v 1.218.1.7 2012/01/13 20:36:20 roberto Exp $
33
** Lua - An Extensible Extension Language
44
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
55
** See Copyright Notice at the end of this file
@@ -17,9 +17,9 @@
1717

1818

1919
#define LUA_VERSION "Lua 5.1"
20-
#define LUA_RELEASE "Lua 5.1.4"
20+
#define LUA_RELEASE "Lua 5.1.5"
2121
#define LUA_VERSION_NUM 501
22-
#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
22+
#define LUA_COPYRIGHT "Copyright (C) 1994-2012 Lua.org, PUC-Rio"
2323
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
2424

2525

@@ -374,7 +374,7 @@ struct lua_Debug {
374374

375375

376376
/******************************************************************************
377-
* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved.
377+
* Copyright (C) 1994-2012 Lua.org, PUC-Rio. All rights reserved.
378378
*
379379
* Permission is hereby granted, free of charge, to any person obtaining
380380
* a copy of this software and associated documentation files (the

src/lvm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: lvm.c,v 2.63.1.4 2009/07/01 21:10:33 roberto Exp $
2+
** $Id: lvm.c,v 2.63.1.5 2011/08/17 20:43:11 roberto Exp $
33
** Lua virtual machine
44
** See Copyright Notice in lua.h
55
*/
@@ -142,6 +142,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
142142
if (!ttisnil(oldval) || /* result is no nil? */
143143
(tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
144144
setobj2t(L, oldval, val);
145+
h->flags = 0;
145146
luaC_barriert(L, h, val);
146147
return;
147148
}

src/lzio.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ int luaZ_fill (ZIO *z) {
2222
size_t size;
2323
lua_State *L = z->L;
2424
const char *buff;
25+
if (z->eoz) return EOZ;
2526
lua_unlock(L);
2627
buff = z->reader(L, z->data, &size);
2728
lua_lock(L);
28-
if (buff == NULL || size == 0) return EOZ;
29+
if (buff == NULL || size == 0) {
30+
z->eoz = 1; /* avoid calling reader function next time */
31+
return EOZ;
32+
}
2933
z->n = size - 1;
3034
z->p = buff;
3135
return char2int(*(z->p++));
@@ -51,6 +55,7 @@ void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) {
5155
z->data = data;
5256
z->n = 0;
5357
z->p = NULL;
58+
z->eoz = 0;
5459
}
5560

5661

src/lzio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ struct Zio {
5959
lua_Reader reader;
6060
void* data; /* additional data */
6161
lua_State *L; /* Lua state (for reader) */
62+
int eoz; /* true if reader has no more data */
6263
};
6364

6465

0 commit comments

Comments
 (0)