diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -1201,8 +1201,8 @@ static const char *const delimits = " \t\n,;"; | |||
1201 | static void skip (const char **pc) { | 1201 | static void skip (const char **pc) { |
1202 | for (;;) { | 1202 | for (;;) { |
1203 | if (**pc != '\0' && strchr(delimits, **pc)) (*pc)++; | 1203 | if (**pc != '\0' && strchr(delimits, **pc)) (*pc)++; |
1204 | else if (**pc == '#') { | 1204 | else if (**pc == '#') { /* comment? */ |
1205 | while (**pc != '\n' && **pc != '\0') (*pc)++; | 1205 | while (**pc != '\n' && **pc != '\0') (*pc)++; /* until end-of-line */ |
1206 | } | 1206 | } |
1207 | else break; | 1207 | else break; |
1208 | } | 1208 | } |
@@ -1544,18 +1544,22 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
1544 | } | 1544 | } |
1545 | else if EQ("setfield") { | 1545 | else if EQ("setfield") { |
1546 | int t = getindex; | 1546 | int t = getindex; |
1547 | lua_setfield(L1, t, getstring); | 1547 | const char *s = getstring; |
1548 | lua_setfield(L1, t, s); | ||
1548 | } | 1549 | } |
1549 | else if EQ("setglobal") { | 1550 | else if EQ("setglobal") { |
1550 | lua_setglobal(L1, getstring); | 1551 | const char *s = getstring; |
1552 | lua_setglobal(L1, s); | ||
1551 | } | 1553 | } |
1552 | else if EQ("sethook") { | 1554 | else if EQ("sethook") { |
1553 | int mask = getnum; | 1555 | int mask = getnum; |
1554 | int count = getnum; | 1556 | int count = getnum; |
1555 | sethookaux(L1, mask, count, getstring); | 1557 | const char *s = getstring; |
1558 | sethookaux(L1, mask, count, s); | ||
1556 | } | 1559 | } |
1557 | else if EQ("setmetatable") { | 1560 | else if EQ("setmetatable") { |
1558 | lua_setmetatable(L1, getindex); | 1561 | int idx = getindex; |
1562 | lua_setmetatable(L1, idx); | ||
1559 | } | 1563 | } |
1560 | else if EQ("settable") { | 1564 | else if EQ("settable") { |
1561 | lua_settable(L1, getindex); | 1565 | lua_settable(L1, getindex); |
@@ -1620,7 +1624,7 @@ static struct X { int x; } x; | |||
1620 | return lua_yieldk(L1, nres, i, Cfunck); | 1624 | return lua_yieldk(L1, nres, i, Cfunck); |
1621 | } | 1625 | } |
1622 | else if EQ("toclose") { | 1626 | else if EQ("toclose") { |
1623 | lua_toclose(L, getnum); | 1627 | lua_toclose(L1, getnum); |
1624 | } | 1628 | } |
1625 | else luaL_error(L, "unknown instruction %s", buff); | 1629 | else luaL_error(L, "unknown instruction %s", buff); |
1626 | } | 1630 | } |