New macro 'getlstr'
Accesses content and length of a 'TString'.
This commit is contained in:
@@ -520,7 +520,8 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
|
||||
** local variable.
|
||||
*/
|
||||
static l_noret jumpscopeerror (LexState *ls, Labeldesc *gt) {
|
||||
const char *varname = getstr(getlocalvardesc(ls->fs, gt->nactvar)->vd.name);
|
||||
TString *tsname = getlocalvardesc(ls->fs, gt->nactvar)->vd.name;
|
||||
const char *varname = getstr(tsname);
|
||||
const char *msg = "<goto %s> at line %d jumps into the scope of local '%s'";
|
||||
msg = luaO_pushfstring(ls->L, msg, getstr(gt->name), gt->line, varname);
|
||||
luaK_semerror(ls, msg); /* raise the error */
|
||||
@@ -1708,7 +1709,8 @@ static void localfunc (LexState *ls) {
|
||||
static int getlocalattribute (LexState *ls) {
|
||||
/* ATTRIB -> ['<' Name '>'] */
|
||||
if (testnext(ls, '<')) {
|
||||
const char *attr = getstr(str_checkname(ls));
|
||||
TString *ts = str_checkname(ls);
|
||||
const char *attr = getstr(ts);
|
||||
checknext(ls, '>');
|
||||
if (strcmp(attr, "const") == 0)
|
||||
return RDKCONST; /* read-only variable */
|
||||
|
||||
Reference in New Issue
Block a user