mems & leaks

- define_start: set above preprocess_start because now
  preprocess_start is defining macros.

- free "cmd_include_files"
- free defines always (after error-longjmps)
- close all files (after error-longjmps)
- tccpe.c: free imports always
- libtcc.c: call tcc_memstats only after all states have
  been deleted.
This commit is contained in:
grischka
2017-02-13 18:23:55 +01:00
parent a4a20360e9
commit 13056da039
4 changed files with 38 additions and 14 deletions

View File

@ -999,14 +999,13 @@ ST_FUNC int tcc_assemble(TCCState *s1, int do_preprocess)
Sym *define_start;
int ret;
define_start = define_stack;
preprocess_start(s1);
/* default section is text */
cur_text_section = text_section;
ind = cur_text_section->data_offset;
define_start = define_stack;
/* an elf symbol of type STT_FILE must be put so that STB_LOCAL
symbols can be safely used */
put_elf_sym(symtab_section, 0, 0,