aboutsummaryrefslogtreecommitdiff
path: root/bugs
diff options
context:
space:
mode:
Diffstat (limited to 'bugs')
-rw-r--r--bugs43
1 files changed, 43 insertions, 0 deletions
diff --git a/bugs b/bugs
index c0eb3271..ad6d0f07 100644
--- a/bugs
+++ b/bugs
@@ -1052,3 +1052,46 @@ patch = [[
1052]], 1052]],
1053 1053
1054} 1054}
1055
1056
1057Bug{
1058what = [[wrong message error in some cases involving closures]],
1059
1060report = [[Shmuel Zeigerman, on 07/2006]],
1061
1062since = "Lua 5.1",
1063
1064example = [[
1065local Var
1066local function main()
1067 NoSuchName (function() Var=0 end)
1068end
1069main()
1070--> lua5.1: temp:3: attempt to call upvalue 'Var' (a nil value)
1071]],
1072
1073patch = [[
1074*ldebug.c:
1075@@ -435,14 +435,16 @@
1076 break;
1077 }
1078 case OP_CLOSURE: {
1079- int nup;
1080+ int nup, j;
1081 check(b < pt->sizep);
1082 nup = pt->p[b]->nups;
1083 check(pc + nup < pt->sizecode);
1084- for (; nup>0; nup--) {
1085- OpCode op1 = GET_OPCODE(pt->code[pc+nup]);
1086+ for (j = 1; j <= nup; j++) {
1087+ OpCode op1 = GET_OPCODE(pt->code[pc + j]);
1088 check(op1 == OP_GETUPVAL || op1 == OP_MOVE);
1089 }
1090+ if (reg != NO_REG) /* tracing? */
1091+ pc += nup; /* do not 'execute' these pseudo-instructions */
1092 break;
1093 }
1094 case OP_VARARG: {
1095]],
1096
1097}