lua

A copy of the Lua development repository
Log | Files | Refs | README

commit c5dc521d654cbe9b04310a633e94dbcf1927e0f6
parent 505fc9122255b8a2ef761720bca21fd5e9be8e73
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  8 Jun 2018 13:22:51 -0300

added patch for bug 5.3.4-7

Diffstat:
Mbugs | 42++++++++++++++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/bugs b/bugs @@ -3680,9 +3680,9 @@ It needs an "interceptor" 'memcmp' function that continues reading memory after a difference is found.]], patch = [[ 2c2 -< ** $Id: bugs,v 1.159 2017/12/13 18:35:03 roberto Exp roberto $ +< ** $Id: bugs,v 1.160 2018/05/24 20:25:14 roberto Exp roberto $ --- -> ** $Id: bugs,v 1.159 2017/12/13 18:35:03 roberto Exp roberto $ +> ** $Id: bugs,v 1.160 2018/05/24 20:25:14 roberto Exp roberto $ 263c263,264 < for (option = LUA_STRFTIMEOPTIONS; *option != '\0'; option += oplen) { --- @@ -3974,6 +3974,44 @@ pcall(rawset, a, 2, 20) -- forces a rehash for k,v in pairs(a) do print(k,v) end ]], patch = [[ +--- ltable.c 2018/05/24 19:39:05 2.118.1.3 ++++ ltable.c 2018/06/04 16:00:25 +@@ -332,17 +332,34 @@ + } + + ++typedef struct { ++ Table *t; ++ unsigned int nhsize; ++} AuxsetnodeT; ++ ++ ++static void auxsetnode (lua_State *L, void *ud) { ++ AuxsetnodeT *asn = cast(AuxsetnodeT *, ud); ++ setnodevector(L, asn->t, asn->nhsize); ++} ++ ++ + void luaH_resize (lua_State *L, Table *t, unsigned int nasize, + unsigned int nhsize) { + unsigned int i; + int j; ++ AuxsetnodeT asn; + unsigned int oldasize = t->sizearray; + int oldhsize = allocsizenode(t); + Node *nold = t->node; /* save old hash ... */ + if (nasize > oldasize) /* array part must grow? */ + setarrayvector(L, t, nasize); + /* create new hash part with appropriate size */ +- setnodevector(L, t, nhsize); ++ asn.t = t; asn.nhsize = nhsize; ++ if (luaD_rawrunprotected(L, auxsetnode, &asn) != LUA_OK) { /* mem. error? */ ++ setarrayvector(L, t, oldasize); /* array back to its original size */ ++ luaD_throw(L, LUA_ERRMEM); /* rethrow memory error */ ++ } + if (nasize < oldasize) { /* array part must shrink? */ + t->sizearray = nasize; + /* re-insert elements from vanishing slice */ ]] }