summaryrefslogtreecommitdiff
path: root/labels.c
diff options
context:
space:
mode:
authorCharles Crayne <chuck@thor.crayne.org>2008-09-11 18:54:06 -0700
committerCharles Crayne <chuck@thor.crayne.org>2008-09-11 18:54:06 -0700
commitc1905c21698642fa94f5887745ecf0336b15ee8c (patch)
treed4fe8d13bfb57458fedb190d42ae75680c90b64f /labels.c
parent4252823e95bb365e704cdd8ae526d2daf01a6533 (diff)
downloadnasm-c1905c21698642fa94f5887745ecf0336b15ee8c.tar.gz
nasm-c1905c21698642fa94f5887745ecf0336b15ee8c.tar.bz2
nasm-c1905c21698642fa94f5887745ecf0336b15ee8c.zip
Halt assembly if addresses are not converging.
Change global_offset_changed from bool to int so that progress of convergence can be monitored. If change count does not decrease from previous pass, increment stall counter. If stall count reaches threshold, terminate assembly with error message.
Diffstat (limited to 'labels.c')
-rw-r--r--labels.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/labels.c b/labels.c
index 068d758..b7a1b44 100644
--- a/labels.c
+++ b/labels.c
@@ -77,7 +77,7 @@ struct permts { /* permanent text storage */
char data[PERMTS_SIZE]; /* ... the data block itself */
};
-extern bool global_offset_changed; /* defined in nasm.c */
+extern int64_t global_offset_changed; /* defined in nasm.c */
static struct hash_table ltab; /* labels hash table */
static union label *ldata; /* all label data blocks */
@@ -209,7 +209,7 @@ void redefine_label(char *label, int32_t segment, int64_t offset, char *special,
prevlabel = lptr->defn.label;
}
- global_offset_changed |= (lptr->defn.offset != offset);
+ if (lptr->defn.offset != offset) global_offset_changed++;
lptr->defn.offset = offset;
lptr->defn.segment = segment;