mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-04 06:30:10 +08:00
fixes for deadlocks and dollars in asm
* tccelf code doesn't use USING_GLOBALS, hence must be called from outside the semaphore * dollars aren't part of identifiers in asm mode
This commit is contained in:
parent
18db8da7df
commit
c883d43ae5
4
libtcc.c
4
libtcc.c
@ -740,9 +740,9 @@ static int tcc_compile(TCCState *s1, int filetype, const char *str, int fd)
|
||||
s1->error_set_jmp_enabled = 0;
|
||||
tccgen_finish(s1);
|
||||
preprocess_end(s1);
|
||||
tccelf_end_file(s1);
|
||||
|
||||
tcc_exit_state();
|
||||
|
||||
tccelf_end_file(s1);
|
||||
return s1->nb_errors != 0 ? -1 : 0;
|
||||
}
|
||||
|
||||
|
2
tccasm.c
2
tccasm.c
@ -1020,6 +1020,7 @@ static void tcc_assemble_inline(TCCState *s1, char *str, int len, int global)
|
||||
{
|
||||
const int *saved_macro_ptr = macro_ptr;
|
||||
int dotid = set_idnum('.', IS_ID);
|
||||
int dolid = set_idnum('$', 0);
|
||||
|
||||
tcc_open_bf(s1, ":asm:", len);
|
||||
memcpy(file->buffer, str, len);
|
||||
@ -1027,6 +1028,7 @@ static void tcc_assemble_inline(TCCState *s1, char *str, int len, int global)
|
||||
tcc_assemble_internal(s1, 0, global);
|
||||
tcc_close();
|
||||
|
||||
set_idnum('$', dolid);
|
||||
set_idnum('.', dotid);
|
||||
macro_ptr = saved_macro_ptr;
|
||||
}
|
||||
|
2
tccpp.c
2
tccpp.c
@ -3691,7 +3691,7 @@ ST_FUNC void preprocess_start(TCCState *s1, int is_asm)
|
||||
s1->pack_stack[0] = 0;
|
||||
s1->pack_stack_ptr = s1->pack_stack;
|
||||
|
||||
set_idnum('$', s1->dollars_in_identifiers ? IS_ID : 0);
|
||||
set_idnum('$', !is_asm && s1->dollars_in_identifiers ? IS_ID : 0);
|
||||
set_idnum('.', is_asm ? IS_ID : 0);
|
||||
|
||||
cstr_new(&cstr);
|
||||
|
Loading…
Reference in New Issue
Block a user