diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-27 13:39:31 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-27 13:39:31 -0200 |
| commit | cfa8bc3ca4befd1df216d8007b8557da2976f359 (patch) | |
| tree | 7376c7bc584fd4cfce8909faf7702c1e7f10341a | |
| parent | a654e82f5c0dcc57d5db385a359379d226054b39 (diff) | |
| download | lua-cfa8bc3ca4befd1df216d8007b8557da2976f359.tar.gz lua-cfa8bc3ca4befd1df216d8007b8557da2976f359.tar.bz2 lua-cfa8bc3ca4befd1df216d8007b8557da2976f359.zip | |
continuations may be upvalues too
| -rw-r--r-- | ltests.c | 9 |
1 files changed, 5 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 2.78 2009/11/05 17:43:54 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.79 2009/11/06 17:08:43 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -875,6 +875,7 @@ static int Cfunck (lua_State *L); | |||
| 875 | 875 | ||
| 876 | static int runC (lua_State *L, lua_State *L1, const char *pc) { | 876 | static int runC (lua_State *L, lua_State *L1, const char *pc) { |
| 877 | char buff[30]; | 877 | char buff[30]; |
| 878 | if (pc == NULL) return luaL_error(L, "attempt to runC null code"); | ||
| 878 | for (;;) { | 879 | for (;;) { |
| 879 | const char *inst = getname; | 880 | const char *inst = getname; |
| 880 | if EQ("") return 0; | 881 | if EQ("") return 0; |
| @@ -1039,13 +1040,13 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
| 1039 | else if EQ("pcallk") { | 1040 | else if EQ("pcallk") { |
| 1040 | int narg = getnum; | 1041 | int narg = getnum; |
| 1041 | int nres = getnum; | 1042 | int nres = getnum; |
| 1042 | int i = getnum; | 1043 | int i = getindex; |
| 1043 | lua_pcallk(L1, narg, nres, 0, i, Cfunck); | 1044 | lua_pcallk(L1, narg, nres, 0, i, Cfunck); |
| 1044 | } | 1045 | } |
| 1045 | else if EQ("callk") { | 1046 | else if EQ("callk") { |
| 1046 | int narg = getnum; | 1047 | int narg = getnum; |
| 1047 | int nres = getnum; | 1048 | int nres = getnum; |
| 1048 | int i = getnum; | 1049 | int i = getindex; |
| 1049 | lua_callk(L1, narg, nres, i, Cfunck); | 1050 | lua_callk(L1, narg, nres, i, Cfunck); |
| 1050 | } | 1051 | } |
| 1051 | else if EQ("yield") { | 1052 | else if EQ("yield") { |
| @@ -1053,7 +1054,7 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
| 1053 | } | 1054 | } |
| 1054 | else if EQ("yieldk") { | 1055 | else if EQ("yieldk") { |
| 1055 | int nres = getnum; | 1056 | int nres = getnum; |
| 1056 | int i = getnum; | 1057 | int i = getindex; |
| 1057 | return lua_yieldk(L1, nres, i, Cfunck); | 1058 | return lua_yieldk(L1, nres, i, Cfunck); |
| 1058 | } | 1059 | } |
| 1059 | else if EQ("loadstring") { | 1060 | else if EQ("loadstring") { |
