mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-30 16:41:05 +08:00
nasm.c: get rid of private copy of bitness
There is no reason to keep a private copy of the value of "globalbits", which needs to be kept in sync anyway. With the move of directive processing to a separate file, this variable wasn't kept up to date, resulting in failures. This resolves BR 3392390. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
parent
d9bc244f8a
commit
cac0b19977
10
asm/nasm.c
10
asm/nasm.c
@ -1190,7 +1190,6 @@ static void assemble_file(char *fname, StrList **depend_ptr)
|
||||
int i;
|
||||
int64_t offs;
|
||||
int pass_max;
|
||||
int sb;
|
||||
uint64_t prev_offset_changed;
|
||||
unsigned int stall_count = 0; /* Make sure we make forward progress... */
|
||||
|
||||
@ -1207,15 +1206,14 @@ static void assemble_file(char *fname, StrList **depend_ptr)
|
||||
|
||||
def_label = passn > 1 ? redefine_label : define_label;
|
||||
|
||||
globalbits = sb = cmd_sb; /* set 'bits' to command line default */
|
||||
globalbits = cmd_sb; /* set 'bits' to command line default */
|
||||
cpu = cmd_cpu;
|
||||
if (pass0 == 2) {
|
||||
lfmt->init(listname);
|
||||
}
|
||||
in_absolute = false;
|
||||
global_offset_changed = 0; /* set by redefine_label */
|
||||
location.segment = ofmt->section(NULL, pass2, &sb);
|
||||
globalbits = sb;
|
||||
location.segment = ofmt->section(NULL, pass2, &globalbits);
|
||||
if (passn > 1) {
|
||||
saa_rewind(forwrefs);
|
||||
forwref = saa_rstruct(forwrefs);
|
||||
@ -1341,7 +1339,7 @@ static void assemble_file(char *fname, StrList **depend_ptr)
|
||||
} else { /* instruction isn't an EQU */
|
||||
|
||||
if (pass1 == 1) {
|
||||
int64_t l = insn_size(location.segment, offs, sb,
|
||||
int64_t l = insn_size(location.segment, offs, globalbits,
|
||||
&output_ins);
|
||||
l *= output_ins.times;
|
||||
|
||||
@ -1421,7 +1419,7 @@ static void assemble_file(char *fname, StrList **depend_ptr)
|
||||
*/
|
||||
|
||||
} else {
|
||||
offs += assemble(location.segment, offs, sb, &output_ins);
|
||||
offs += assemble(location.segment, offs, globalbits, &output_ins);
|
||||
set_curr_offs(offs);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user