History

VLA leaks vstack. added warning to detect future leaks

Joe Soroka committed 15 years ago

Commit 6eb97c71 parent c94f8051 file · +4 −0Browse files

Unified · Split

libtcc.c+4−0
@@ -689,6 +689,7 @@ ST_FUNC int tcc_open(TCCState *s1, const char *filename) · 688 unmodified lines
689static int tcc_compile(TCCState *s1)689static int tcc_compile(TCCState *s1)
690{690{
691 Sym *define_start;691 Sym *define_start;
692 SValue *pvtop;
692 char buf[512];693 char buf[512];
693 volatile int section_sym;694 volatile int section_sym;
694 695
@@ -758,6 +759,7 @@ static int tcc_compile(TCCState *s1) · 63 unmodified lines
758 759
759 define_start = define_stack;760 define_start = define_stack;
760 nocode_wanted = 1;761 nocode_wanted = 1;
762 pvtop = vtop;
761 763
762 if (setjmp(s1->error_jmp_buf) == 0) {764 if (setjmp(s1->error_jmp_buf) == 0) {
763 s1->nb_errors = 0;765 s1->nb_errors = 0;
@@ -787,6 +789,8 @@ static int tcc_compile(TCCState *s1) · 23 unmodified lines
787 789
788 sym_pop(&global_stack, NULL);790 sym_pop(&global_stack, NULL);
789 sym_pop(&local_stack, NULL);791 sym_pop(&local_stack, NULL);
792 if (pvtop != vtop)
793 warning("internal compiler error: vstack leak? (%d)", vtop - pvtop);
790 794
791 return s1->nb_errors != 0 ? -1 : 0;795 return s1->nb_errors != 0 ? -1 : 0;
792}796}

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