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:
H. Peter Anvin 2018-06-14 20:00:07 -07:00
parent af5f918a92
commit 46c839a03d

View File

@ -424,11 +424,8 @@ void define_label(const char *label, int32_t segment,
nasm_error(ERR_WARNING, "label `%s' defined on pass two", label);
}
if (!segment) {
segment = lptr->defn.segment;
if (!segment)
segment = lptr->defn.segment = seg_alloc();
}
if (!segment)
segment = lptr->defn.segment ? lptr->defn.segment : seg_alloc();
if (lptr->defn.defined || lptr->defn.type == LBL_BACKEND) {
/* We have seen this on at least one previous pass */