aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 10:36:14 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 10:36:14 -0300
commitca41b43f53562e64abe433d6346d174c92548603 (patch)
tree03f7a99f76359fc1e0bbc45fc13e579ff2aafabb /ltests.c
parent3511e186cde4b78f268d17199d0f46fb3eaa9638 (diff)
downloadlua-ca41b43f53562e64abe433d6346d174c92548603.tar.gz
lua-ca41b43f53562e64abe433d6346d174c92548603.tar.bz2
lua-ca41b43f53562e64abe433d6346d174c92548603.zip
type 'TString' refers directly to the structure inside the union
(union used only for size purposes)
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/ltests.c b/ltests.c
index 13cfa043..fde7fdcd 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.177 2014/07/17 17:27:49 roberto Exp roberto $ 2** $Id: ltests.c,v 2.178 2014/07/18 12:17:54 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*/
@@ -210,9 +210,6 @@ static int testobjref (global_State *g, GCObject *f, GCObject *t) {
210#define checkobjref(g,f,t) \ 210#define checkobjref(g,f,t) \
211 { if (t) lua_longassert(testobjref(g,f,obj2gco(t))); } 211 { if (t) lua_longassert(testobjref(g,f,obj2gco(t))); }
212 212
213#define checkstrref(g,f,t) \
214 { if (t) lua_longassert(testobjref(g,f,ts2gco(t))); }
215
216 213
217static void checkvalref (global_State *g, GCObject *f, const TValue *t) { 214static void checkvalref (global_State *g, GCObject *f, const TValue *t) {
218 lua_assert(!iscollectable(t) || 215 lua_assert(!iscollectable(t) ||
@@ -245,17 +242,17 @@ static void checkproto (global_State *g, Proto *f) {
245 int i; 242 int i;
246 GCObject *fgc = obj2gco(f); 243 GCObject *fgc = obj2gco(f);
247 checkobjref(g, fgc, f->cache); 244 checkobjref(g, fgc, f->cache);
248 checkstrref(g, fgc, f->source); 245 checkobjref(g, fgc, f->source);
249 for (i=0; i<f->sizek; i++) { 246 for (i=0; i<f->sizek; i++) {
250 if (ttisstring(f->k + i)) 247 if (ttisstring(f->k + i))
251 checkobjref(g, fgc, tsvalue(f->k + i)); 248 checkobjref(g, fgc, tsvalue(f->k + i));
252 } 249 }
253 for (i=0; i<f->sizeupvalues; i++) 250 for (i=0; i<f->sizeupvalues; i++)
254 checkstrref(g, fgc, f->upvalues[i].name); 251 checkobjref(g, fgc, f->upvalues[i].name);
255 for (i=0; i<f->sizep; i++) 252 for (i=0; i<f->sizep; i++)
256 checkobjref(g, fgc, f->p[i]); 253 checkobjref(g, fgc, f->p[i]);
257 for (i=0; i<f->sizelocvars; i++) 254 for (i=0; i<f->sizelocvars; i++)
258 checkstrref(g, fgc, f->locvars[i].varname); 255 checkobjref(g, fgc, f->locvars[i].varname);
259} 256}
260 257
261 258
@@ -701,7 +698,7 @@ static int string_query (lua_State *L) {
701 else if (s < tb->size) { 698 else if (s < tb->size) {
702 TString *ts; 699 TString *ts;
703 int n = 0; 700 int n = 0;
704 for (ts = tb->hash[s]; ts != NULL; ts = ts->tsv.hnext) { 701 for (ts = tb->hash[s]; ts != NULL; ts = ts->hnext) {
705 setsvalue2s(L, L->top, ts); 702 setsvalue2s(L, L->top, ts);
706 api_incr_top(L); 703 api_incr_top(L);
707 n++; 704 n++;