mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
added check for conversion 'obj2gco' (and corrections for small
problems detected by this check)
This commit is contained in:
parent
9aec500a26
commit
56137d58ff
10 changed files with 51 additions and 39 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lstring.c,v 2.39 2014/04/02 16:44:42 roberto Exp roberto $
|
||||
** $Id: lstring.c,v 2.40 2014/06/18 22:59:29 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->tsv.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, ts2gco(ts))) /* dead (but not collected yet)? */
|
||||
changewhite(ts2gco(ts)); /* resurrect it */
|
||||
return ts;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue