aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ltests.c b/ltests.c
index 7845716f..7eb03939 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 1.64 2001/02/06 18:18:58 roberto Exp roberto $ 2** $Id: ltests.c,v 1.65 2001/02/09 19:53:16 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*/
@@ -201,7 +201,7 @@ static int liststrings (lua_State *L) {
201 lua_newtable(L); 201 lua_newtable(L);
202 for (i=0; i<p->sizekstr; i++) { 202 for (i=0; i<p->sizekstr; i++) {
203 lua_pushnumber(L, i+1); 203 lua_pushnumber(L, i+1);
204 lua_pushstring(L, p->kstr[i]->str); 204 lua_pushstring(L, getstr(p->kstr[i]));
205 lua_settable(L, -3); 205 lua_settable(L, -3);
206 } 206 }
207 return 1; 207 return 1;
@@ -537,7 +537,9 @@ static int testC (lua_State *L) {
537 lua_pushnumber(L, lua_tonumber(L, getnum)); 537 lua_pushnumber(L, lua_tonumber(L, getnum));
538 } 538 }
539 else if EQ("tostring") { 539 else if EQ("tostring") {
540 lua_pushstring(L, lua_tostring(L, getnum)); 540 const char *s = lua_tostring(L, getnum);
541 lua_assert((unsigned long)s % 4 == 0); /* check alignment */
542 lua_pushstring(L, s);
541 } 543 }
542 else if EQ("tonumber") { 544 else if EQ("tonumber") {
543 lua_pushnumber(L, lua_tonumber(L, getnum)); 545 lua_pushnumber(L, lua_tonumber(L, getnum));