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
1615#endif1615#endif
1616 1616
1617/* Wrapper around sym_pop, that potentially also registers local bounds. */1617/* Wrapper around sym_pop, that potentially also registers local bounds. */
1618static void pop_local_syms(Sym **ptop, Sym *b, int keep)1618static void pop_local_syms(Sym **ptop, Sym *b, int keep, int ellipsis)
1619{1619{
1620#ifdef CONFIG_TCC_BCHECK1620#ifdef CONFIG_TCC_BCHECK
1621 if (!keep && tcc_state->do_bounds_check)1621 if (!ellipsis && !keep && tcc_state->do_bounds_check)
1622 add_local_bounds(*ptop, b);1622 add_local_bounds(*ptop, b);
1623#endif1623#endif
1624 sym_pop(ptop, b, keep);1624 sym_pop(ptop, b, keep);
@@ -6411,7 +6411,7 @@ void prev_scope(struct scope *o, int is_expr) · 4786 unmodified lines
6411 tables, though. sym_pop will do that. */6411 tables, though. sym_pop will do that. */
6412 6412
6413 /* pop locally defined symbols */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 cur_scope = o->prev;6416 cur_scope = o->prev;
6417 --local_scope;6417 --local_scope;
@@ -7656,7 +7656,8 @@ static void gen_function(Sym *sym, AttributeDef *ad) · 1238 unmodified lines
7656 gsym(rsym);7656 gsym(rsym);
7657 nocode_wanted = 0;7657 nocode_wanted = 0;
7658 /* reset local stack */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 gfunc_epilog();7661 gfunc_epilog();
7661 cur_text_section->data_offset = ind;7662 cur_text_section->data_offset = ind;
7662 local_scope = 0;7663 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