Unified · Split
| @@ -1615,10 +1615,10 @@ static void add_local_bounds(Sym *s, Sym *e) · 1614 unmodified lines | ||
| 1615 | 1615 | #endif |
| 1616 | 1616 | |
| 1617 | 1617 | /* Wrapper around sym_pop, that potentially also registers local bounds. */ |
| 1618 | −static void pop_local_syms(Sym **ptop, Sym *b, int keep) | |
| 1618 | +static void pop_local_syms(Sym **ptop, Sym *b, int keep, int ellipsis) | |
| 1619 | 1619 | { |
| 1620 | 1620 | #ifdef CONFIG_TCC_BCHECK |
| 1621 | − if (!keep && tcc_state->do_bounds_check) | |
| 1621 | + if (!ellipsis && !keep && tcc_state->do_bounds_check) | |
| 1622 | 1622 | add_local_bounds(*ptop, b); |
| 1623 | 1623 | #endif |
| 1624 | 1624 | sym_pop(ptop, b, keep); |
| @@ -6411,7 +6411,7 @@ void prev_scope(struct scope *o, int is_expr) · 4786 unmodified lines | ||
| 6411 | 6411 | tables, though. sym_pop will do that. */ |
| 6412 | 6412 | |
| 6413 | 6413 | /* pop locally defined symbols */ |
| 6414 | − pop_local_syms(&local_stack, o->lstk, is_expr); | |
| 6414 | + pop_local_syms(&local_stack, o->lstk, is_expr, 0); | |
| 6415 | 6415 | |
| 6416 | 6416 | cur_scope = o->prev; |
| 6417 | 6417 | --local_scope; |
| @@ -7656,7 +7656,8 @@ static void gen_function(Sym *sym, AttributeDef *ad) · 1238 unmodified lines | ||
| 7656 | 7656 | gsym(rsym); |
| 7657 | 7657 | nocode_wanted = 0; |
| 7658 | 7658 | /* reset local stack */ |
| 7659 | − pop_local_syms(&local_stack, NULL, 0); | |
| 7659 | + pop_local_syms(&local_stack, NULL, 0, | |
| 7660 | + sym->type.ref->f.func_type == FUNC_ELLIPSIS); | |
| 7660 | 7661 | gfunc_epilog(); |
| 7661 | 7662 | cur_text_section->data_offset = ind; |
| 7662 | 7663 | local_scope = 0; |