diff options
Diffstat (limited to 'src/lj_parse.c')
-rw-r--r-- | src/lj_parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_parse.c b/src/lj_parse.c index 31a70d38..b5bd7baf 100644 --- a/src/lj_parse.c +++ b/src/lj_parse.c | |||
@@ -189,6 +189,7 @@ static BCReg const_gc(FuncState *fs, GCobj *gc, int itype) | |||
189 | lua_State *L = fs->L; | 189 | lua_State *L = fs->L; |
190 | TValue o, *val; | 190 | TValue o, *val; |
191 | setgcV(L, &o, &gc->gch, itype); | 191 | setgcV(L, &o, &gc->gch, itype); |
192 | /* NOBARRIER: the key is new or kept alive. */ | ||
192 | val = lj_tab_set(L, fs->kt, &o); | 193 | val = lj_tab_set(L, fs->kt, &o); |
193 | if (tvisnum(val)) | 194 | if (tvisnum(val)) |
194 | return val->u32.lo; | 195 | return val->u32.lo; |
@@ -206,6 +207,7 @@ static BCReg const_str(FuncState *fs, ExpDesc *e) | |||
206 | /* Anchor string constant to avoid GC. */ | 207 | /* Anchor string constant to avoid GC. */ |
207 | GCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t len) | 208 | GCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t len) |
208 | { | 209 | { |
210 | /* NOBARRIER: the key is new or kept alive. */ | ||
209 | lua_State *L = ls->L; | 211 | lua_State *L = ls->L; |
210 | GCstr *s = lj_str_new(L, str, len); | 212 | GCstr *s = lj_str_new(L, str, len); |
211 | TValue *tv = lj_tab_setstr(L, ls->fs->kt, s); | 213 | TValue *tv = lj_tab_setstr(L, ls->fs->kt, s); |
@@ -1202,6 +1204,7 @@ static GCproto *fs_finish(LexState *ls, BCLine line) | |||
1202 | lua_assert(ls->fs != NULL || ls->token == TK_eof); | 1204 | lua_assert(ls->fs != NULL || ls->token == TK_eof); |
1203 | /* Re-anchor last string token to avoid GC. */ | 1205 | /* Re-anchor last string token to avoid GC. */ |
1204 | if (ls->token == TK_name || ls->token == TK_string) { | 1206 | if (ls->token == TK_name || ls->token == TK_string) { |
1207 | /* NOBARRIER: the key is new or kept alive. */ | ||
1205 | TValue *tv = lj_tab_setstr(ls->L, ls->fs->kt, strV(&ls->tokenval)); | 1208 | TValue *tv = lj_tab_setstr(ls->L, ls->fs->kt, strV(&ls->tokenval)); |
1206 | if (tvisnil(tv)) setboolV(tv, 1); | 1209 | if (tvisnil(tv)) setboolV(tv, 1); |
1207 | } | 1210 | } |
@@ -1346,8 +1349,7 @@ static void expr_table(LexState *ls, ExpDesc *e) | |||
1346 | vcall = 0; | 1349 | vcall = 0; |
1347 | expr_kvalue(&k, &key); | 1350 | expr_kvalue(&k, &key); |
1348 | expr_kvalue(lj_tab_set(fs->L, t, &k), &val); | 1351 | expr_kvalue(lj_tab_set(fs->L, t, &k), &val); |
1349 | if (val.k == VKSTR) | 1352 | lj_gc_anybarriert(fs->L, t); |
1350 | lj_gc_objbarriert(fs->L, t, val.u.sval); | ||
1351 | } else { | 1353 | } else { |
1352 | if (val.k != VCALL) { expr_toanyreg(fs, &val); vcall = 0; } | 1354 | if (val.k != VCALL) { expr_toanyreg(fs, &val); vcall = 0; } |
1353 | if (expr_isk(&key)) expr_index(fs, e, &key); | 1355 | if (expr_isk(&key)) expr_index(fs, e, &key); |