MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

prevent T_TAILCALL leaks in `resolveprop`

+7 -3
+7 -3
src/ant.c
··· 6074 6074 } 6075 6075 6076 6076 jsval_t resolveprop(struct js *js, jsval_t v) { 6077 + assert(v != (jsval_t)T_TAILCALL && "T_TAILCALL leaked into resolveprop"); 6077 6078 if (is_new_target_ref(v)) return current_lexical_new_target(js); 6078 6079 6079 6080 if (vtype(v) == T_PROPREF) { ··· 7505 7506 const char *body, jsoff_t body_len, bool is_expr 7506 7507 ) { 7507 7508 if (!ts || ts->count == 0) return false; 7508 - if (is_expr) return scan_tail_span(body, body_len, 0, body_len) == TAIL_OK; 7509 + if (is_expr) return return_expr_is_tail_call(ts, 0, body, body_len); 7509 7510 7510 7511 const cached_token_t *restrict toks = ts->tokens; 7511 7512 const int count = ts->count; ··· 7915 7916 js->tc.args = NULL; 7916 7917 7917 7918 restore_saved_scope(js); 7919 + assert(res != (jsval_t)T_TAILCALL && "T_TAILCALL escaped call_js_internal"); 7918 7920 return res; 7919 7921 } 7920 7922 ··· 12316 12318 12317 12319 if (exe) loop_block_init(js, &forin_loop_ctx); 12318 12320 js->flags |= F_NOEXEC; 12319 - v = js_block_or_stmt_pos(js, &body_end_pos); 12321 + v = js_block_or_stmt(js); 12320 12322 if (is_err2(&v, &res)) goto done; 12321 12323 12324 + body_end_pos = js->pos; 12322 12325 body_end_token = js->tok; 12323 12326 body_end_consumed = js->consumed; 12324 12327 body_end_toff = js->toff; ··· 12367 12370 12368 12371 if (exe) loop_block_init(js, &forof_loop_ctx); 12369 12372 js->flags |= F_NOEXEC; 12370 - v = js_block_or_stmt_pos(js, &body_end_pos); 12373 + v = js_block_or_stmt(js); 12371 12374 if (is_err2(&v, &res)) goto done; 12372 12375 12376 + body_end_pos = js->pos; 12373 12377 body_end_token = js->tok; 12374 12378 body_end_consumed = js->consumed; 12375 12379 body_end_toff = js->toff;