mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-18 18:50:23 +08:00
nasm: need to call init_labels() before command line parsing
The prefix and suffix options call perm_alloc() in labels.c, which is not available until init_labels() have run. There is no reason not to call init_labels() early. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
bc77f9c587
commit
87d9e626c3
14
asm/nasm.c
14
asm/nasm.c
@ -424,6 +424,13 @@ int main(int argc, char **argv)
|
||||
tolower_init();
|
||||
src_init();
|
||||
|
||||
/*
|
||||
* We must call init_labels() before the command line parsing,
|
||||
* because we may be setting prefixes/suffixes from the command
|
||||
* line.
|
||||
*/
|
||||
init_labels();
|
||||
|
||||
offsets = raa_init();
|
||||
forwrefs = saa_init((int32_t)sizeof(struct forwrefinfo));
|
||||
|
||||
@ -553,13 +560,6 @@ int main(int argc, char **argv)
|
||||
nasm_fatal(ERR_NOFILE,
|
||||
"unable to open output file `%s'", outname);
|
||||
|
||||
/*
|
||||
* We must call init_labels() before ofmt->init() since
|
||||
* some object formats will want to define labels in their
|
||||
* init routines. (eg OS/2 defines the FLAT group)
|
||||
*/
|
||||
init_labels();
|
||||
|
||||
ofmt->init();
|
||||
dfmt->init();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user