summaryrefslogtreecommitdiff
path: root/bugs
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-05-08 13:55:08 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-05-08 13:55:08 -0300
commita3af42de8e65d8ac70684242589ca5e30c73c548 (patch)
tree4ec484a5bc8a7d6c5bfa8cd3a4d0fc6eb2d9f659 /bugs
parent198be23f36466496228bdbceac2d4b8c01e3c21c (diff)
downloadlua-github-a3af42de8e65d8ac70684242589ca5e30c73c548.tar.gz
patch for "blow stack" bug
Diffstat (limited to 'bugs')
-rw-r--r--bugs32
1 files changed, 30 insertions, 2 deletions
diff --git a/bugs b/bugs
index b57de4fc..ebaea05d 100644
--- a/bugs
+++ b/bugs
@@ -1875,7 +1875,35 @@ function crash(depth)
end
for i=1,25 do print(i); crash(i) end
]],
-patch = [[ ]],
+patch = [[
+--- lundump.c 2008/04/04 16:00:45 2.7.1.3
++++ lundump.c 2008/04/04 19:51:41 2.7.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: lundump.c,v 2.7.1.3 2008/04/04 16:00:45 roberto Exp $
++** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $
+ ** load precompiled Lua chunks
+ ** See Copyright Notice in lua.h
+ */
+@@ -161,7 +161,9 @@
+
+ static Proto* LoadFunction(LoadState* S, TString* p)
+ {
+- Proto* f=luaF_newproto(S->L);
++ Proto* f;
++ if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
++ f=luaF_newproto(S->L);
+ setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
+ f->source=LoadString(S); if (f->source==NULL) f->source=p;
+ f->linedefined=LoadInt(S);
+@@ -175,6 +177,7 @@
+ LoadDebug(S,f);
+ IF (!luaG_checkcode(f), "bad code");
+ S->L->top--;
++ S->L->nCcalls--;
+ return f;
+ }
+]],
}
Bug{
@@ -1905,7 +1933,7 @@ patch = [[
+ have the same value of an invalid setlist; so, we must
+ go all the way back to the first of them (if any) */
+ for (j = 0; j < dest; j++) {
-+ Instruction d = pt->code[dest-1];
++ Instruction d = pt->code[dest-1-j];
+ if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break;
+ }
+ /* if 'j' is even, previous value is not a setlist (even if