diff options
Diffstat (limited to 'lparser.c')
-rw-r--r-- | lparser.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -520,7 +520,8 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) { | |||
520 | ** local variable. | 520 | ** local variable. |
521 | */ | 521 | */ |
522 | static l_noret jumpscopeerror (LexState *ls, Labeldesc *gt) { | 522 | static l_noret jumpscopeerror (LexState *ls, Labeldesc *gt) { |
523 | const char *varname = getstr(getlocalvardesc(ls->fs, gt->nactvar)->vd.name); | 523 | TString *tsname = getlocalvardesc(ls->fs, gt->nactvar)->vd.name; |
524 | const char *varname = getstr(tsname); | ||
524 | const char *msg = "<goto %s> at line %d jumps into the scope of local '%s'"; | 525 | const char *msg = "<goto %s> at line %d jumps into the scope of local '%s'"; |
525 | msg = luaO_pushfstring(ls->L, msg, getstr(gt->name), gt->line, varname); | 526 | msg = luaO_pushfstring(ls->L, msg, getstr(gt->name), gt->line, varname); |
526 | luaK_semerror(ls, msg); /* raise the error */ | 527 | luaK_semerror(ls, msg); /* raise the error */ |
@@ -1708,7 +1709,8 @@ static void localfunc (LexState *ls) { | |||
1708 | static int getlocalattribute (LexState *ls) { | 1709 | static int getlocalattribute (LexState *ls) { |
1709 | /* ATTRIB -> ['<' Name '>'] */ | 1710 | /* ATTRIB -> ['<' Name '>'] */ |
1710 | if (testnext(ls, '<')) { | 1711 | if (testnext(ls, '<')) { |
1711 | const char *attr = getstr(str_checkname(ls)); | 1712 | TString *ts = str_checkname(ls); |
1713 | const char *attr = getstr(ts); | ||
1712 | checknext(ls, '>'); | 1714 | checknext(ls, '>'); |
1713 | if (strcmp(attr, "const") == 0) | 1715 | if (strcmp(attr, "const") == 0) |
1714 | return RDKCONST; /* read-only variable */ | 1716 | return RDKCONST; /* read-only variable */ |