mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-30 16:41:05 +08:00
labels: allocation of a segment number counts as a change
If we allocate a new segment number, that has to cause global_offset_changed to be incremented. Thus, we should not update lptr->defn.segment until that would ordinarily be done. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
parent
af5f918a92
commit
46c839a03d
@ -424,11 +424,8 @@ void define_label(const char *label, int32_t segment,
|
|||||||
nasm_error(ERR_WARNING, "label `%s' defined on pass two", label);
|
nasm_error(ERR_WARNING, "label `%s' defined on pass two", label);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!segment) {
|
|
||||||
segment = lptr->defn.segment;
|
|
||||||
if (!segment)
|
if (!segment)
|
||||||
segment = lptr->defn.segment = seg_alloc();
|
segment = lptr->defn.segment ? lptr->defn.segment : seg_alloc();
|
||||||
}
|
|
||||||
|
|
||||||
if (lptr->defn.defined || lptr->defn.type == LBL_BACKEND) {
|
if (lptr->defn.defined || lptr->defn.type == LBL_BACKEND) {
|
||||||
/* We have seen this on at least one previous pass */
|
/* We have seen this on at least one previous pass */
|
||||||
|
Loading…
Reference in New Issue
Block a user