summaryrefslogtreecommitdiffstats
path: root/patches/lua-5.1.4/0011-Parser-may-collect-a-prototype-while-building-it.patch
blob: 94ee2e480f711e29768112a94aabd12809fdd995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= <benoit.burnichon@airtag.com>
Date: Tue, 6 Dec 2011 14:28:19 +0100
Subject: [PATCH] Parser may collect a prototype while building it.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Comes from http://www.lua.org/bugs.html#5.1.4-11

reported by Ingo van Lil on 13 Oct 2011.

Signed-off-by: Benoît Burnichon <benoit.burnichon@airtag.com>
---
 src/lparser.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lparser.c b/src/lparser.c
index 1e2a9a8..a2721d2 100644
--- a/src/lparser.c
+++ b/src/lparser.c
@@ -374,9 +374,9 @@ static void close_func (LexState *ls) {
   lua_assert(luaG_checkcode(f));
   lua_assert(fs->bl == NULL);
   ls->fs = fs->prev;
-  L->top -= 2;  /* remove table and prototype from the stack */
   /* last token read was anchored in defunct function; must reanchor it */
   if (fs) anchor_token(ls);
+  L->top -= 2;  /* remove table and prototype from the stack */
 }