1
0
mirror of https://github.com/lua/lua.git synced 2025-01-14 05:43:00 +08:00

continuations may be upvalues too

This commit is contained in:
Roberto Ierusalimschy 2009-11-27 13:39:31 -02:00
parent a654e82f5c
commit cfa8bc3ca4

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ltests.c,v 2.78 2009/11/05 17:43:54 roberto Exp roberto $ ** $Id: ltests.c,v 2.79 2009/11/06 17:08:43 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation ** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -875,6 +875,7 @@ static int Cfunck (lua_State *L);
static int runC (lua_State *L, lua_State *L1, const char *pc) { static int runC (lua_State *L, lua_State *L1, const char *pc) {
char buff[30]; char buff[30];
if (pc == NULL) return luaL_error(L, "attempt to runC null code");
for (;;) { for (;;) {
const char *inst = getname; const char *inst = getname;
if EQ("") return 0; if EQ("") return 0;
@ -1039,13 +1040,13 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
else if EQ("pcallk") { else if EQ("pcallk") {
int narg = getnum; int narg = getnum;
int nres = getnum; int nres = getnum;
int i = getnum; int i = getindex;
lua_pcallk(L1, narg, nres, 0, i, Cfunck); lua_pcallk(L1, narg, nres, 0, i, Cfunck);
} }
else if EQ("callk") { else if EQ("callk") {
int narg = getnum; int narg = getnum;
int nres = getnum; int nres = getnum;
int i = getnum; int i = getindex;
lua_callk(L1, narg, nres, i, Cfunck); lua_callk(L1, narg, nres, i, Cfunck);
} }
else if EQ("yield") { else if EQ("yield") {
@ -1053,7 +1054,7 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
} }
else if EQ("yieldk") { else if EQ("yieldk") {
int nres = getnum; int nres = getnum;
int i = getnum; int i = getindex;
return lua_yieldk(L1, nres, i, Cfunck); return lua_yieldk(L1, nres, i, Cfunck);
} }
else if EQ("loadstring") { else if EQ("loadstring") {