'iswhite' and related macros now can work directly on any object

(no need to convert to 'GCObject')
This commit is contained in:
Roberto Ierusalimschy
2014-07-21 13:02:10 -03:00
parent 3c6d0aaa7d
commit 17ee57f8e0
3 changed files with 9 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstring.c,v 2.42 2014/07/18 13:36:14 roberto Exp roberto $
** $Id: lstring.c,v 2.43 2014/07/18 14:46:47 roberto Exp roberto $
** String table (keeps all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ -126,8 +126,8 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) {
if (l == ts->len &&
(memcmp(str, getstr(ts), l * sizeof(char)) == 0)) {
/* found! */
if (isdead(g, obj2gco(ts))) /* dead (but not collected yet)? */
changewhite(obj2gco(ts)); /* resurrect it */
if (isdead(g, ts)) /* dead (but not collected yet)? */
changewhite(ts); /* resurrect it */
return ts;
}
}