History

Exclude ellipsis functions from bounds checking. This fails on i386.

herman ten brugge committed 6 years ago

Commit 4092b051 parent c2976961 file · +5 −4Browse files

Unified · Split

tccgen.c+5−4
@@ -1615,10 +1615,10 @@ static void add_local_bounds(Sym *s, Sym *e) · 1614 unmodified lines
16151615 #endif
16161616
16171617 /* 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)
16191619 {
16201620 #ifdef CONFIG_TCC_BCHECK
1621− if (!keep && tcc_state->do_bounds_check)
1621+ if (!ellipsis && !keep && tcc_state->do_bounds_check)
16221622 add_local_bounds(*ptop, b);
16231623 #endif
16241624 sym_pop(ptop, b, keep);
@@ -6411,7 +6411,7 @@ void prev_scope(struct scope *o, int is_expr) · 4786 unmodified lines
64116411 tables, though. sym_pop will do that. */
64126412
64136413 /* 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);
64156415
64166416 cur_scope = o->prev;
64176417 --local_scope;
@@ -7656,7 +7656,8 @@ static void gen_function(Sym *sym, AttributeDef *ad) · 1238 unmodified lines
76567656 gsym(rsym);
76577657 nocode_wanted = 0;
76587658 /* 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);
76607661 gfunc_epilog();
76617662 cur_text_section->data_offset = ind;
76627663 local_scope = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t