From d2e340f467a46017fa3526074c1756124e569880 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 9 Feb 2001 18:22:29 -0200 Subject: string pointers are always fully aligned --- ltests.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 7845716f..7eb03939 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 1.64 2001/02/06 18:18:58 roberto Exp roberto $ +** $Id: ltests.c,v 1.65 2001/02/09 19:53:16 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -201,7 +201,7 @@ static int liststrings (lua_State *L) { lua_newtable(L); for (i=0; isizekstr; i++) { lua_pushnumber(L, i+1); - lua_pushstring(L, p->kstr[i]->str); + lua_pushstring(L, getstr(p->kstr[i])); lua_settable(L, -3); } return 1; @@ -537,7 +537,9 @@ static int testC (lua_State *L) { lua_pushnumber(L, lua_tonumber(L, getnum)); } else if EQ("tostring") { - lua_pushstring(L, lua_tostring(L, getnum)); + const char *s = lua_tostring(L, getnum); + lua_assert((unsigned long)s % 4 == 0); /* check alignment */ + lua_pushstring(L, s); } else if EQ("tonumber") { lua_pushnumber(L, lua_tonumber(L, getnum)); -- cgit v1.2.3-55-g6feb