aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-09 18:22:29 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-09 18:22:29 -0200
commitd2e340f467a46017fa3526074c1756124e569880 (patch)
treee5b08773a0f0734193b0c1c435fab8ee243f08dc /lvm.c
parent6875fdc8be9029b1bb29379c59d5409a0df42c10 (diff)
downloadlua-d2e340f467a46017fa3526074c1756124e569880.tar.gz
lua-d2e340f467a46017fa3526074c1756124e569880.tar.bz2
lua-d2e340f467a46017fa3526074c1756124e569880.zip
string pointers are always fully aligned
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lvm.c b/lvm.c
index 5e0c6d3a..39c5f6d3 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.166 2001/02/07 18:13:49 roberto Exp roberto $ 2** $Id: lvm.c,v 1.167 2001/02/09 18:07:47 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -225,9 +225,9 @@ static void call_arith (lua_State *L, StkId p1, TMS event) {
225 225
226 226
227static int luaV_strlessthan (const TString *ls, const TString *rs) { 227static int luaV_strlessthan (const TString *ls, const TString *rs) {
228 const char *l = ls->str; 228 const char *l = getstr(ls);
229 size_t ll = ls->len; 229 size_t ll = ls->len;
230 const char *r = rs->str; 230 const char *r = getstr(rs);
231 size_t lr = rs->len; 231 size_t lr = rs->len;
232 for (;;) { 232 for (;;) {
233 int temp = strcoll(l, r); 233 int temp = strcoll(l, r);
@@ -281,7 +281,7 @@ void luaV_strconc (lua_State *L, int total, StkId top) {
281 tl = 0; 281 tl = 0;
282 for (i=n; i>0; i--) { /* concat all strings */ 282 for (i=n; i>0; i--) { /* concat all strings */
283 size_t l = tsvalue(top-i)->len; 283 size_t l = tsvalue(top-i)->len;
284 memcpy(buffer+tl, tsvalue(top-i)->str, l); 284 memcpy(buffer+tl, svalue(top-i), l);
285 tl += l; 285 tl += l;
286 } 286 }
287 setsvalue(top-n, luaS_newlstr(L, buffer, tl)); 287 setsvalue(top-n, luaS_newlstr(L, buffer, tl));