Merge branch 'master' into v2.1

This commit is contained in:
Mike Pall 2016-03-22 20:42:00 +01:00
commit cf3e01e136
3 changed files with 3 additions and 2 deletions

View File

@ -9,7 +9,7 @@
/* Context for the folding hash table generator. */ /* Context for the folding hash table generator. */
static int lineno; static int lineno;
static int funcidx; static uint32_t funcidx;
static uint32_t foldkeys[BUILD_MAX_FOLD]; static uint32_t foldkeys[BUILD_MAX_FOLD];
static uint32_t nkeys; static uint32_t nkeys;

View File

@ -300,6 +300,7 @@ local function strip_unused3(src)
src = gsub(src, "if%([^\n]*hookmask[^\n]*&&\n[^\n]*%b{}\n", "") src = gsub(src, "if%([^\n]*hookmask[^\n]*&&\n[^\n]*%b{}\n", "")
src = gsub(src, "(twoto%b()%()", "%1(size_t)") src = gsub(src, "(twoto%b()%()", "%1(size_t)")
src = gsub(src, "i<sizenode", "i<(int)sizenode") src = gsub(src, "i<sizenode", "i<(int)sizenode")
src = gsub(src, "cast%(unsigned int,key%-1%)", "cast(unsigned int,key)-1")
return gsub(src, "\n\n+", "\n") return gsub(src, "\n\n+", "\n")
end end

View File

@ -1606,7 +1606,7 @@ luaC_barriert(L,t,key);
return gval(mp); return gval(mp);
} }
static const TValue*luaH_getnum(Table*t,int key){ static const TValue*luaH_getnum(Table*t,int key){
if(cast(unsigned int,key-1)<cast(unsigned int,t->sizearray)) if(cast(unsigned int,key)-1<cast(unsigned int,t->sizearray))
return&t->array[key-1]; return&t->array[key-1];
else{ else{
lua_Number nk=cast_num(key); lua_Number nk=cast_num(key);