outobj: handle the case of SEG <undefined> in pass 0
SEG <undefined> can happen, validly, for a common symbol during the optimization passes. It better not happen during the real passes, however! Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
807bed5ffd
commit
d3544ff534
1 changed files with 12 additions and 4 deletions
|
@ -1808,14 +1808,22 @@ static int32_t obj_segbase(int32_t segment)
|
||||||
}
|
}
|
||||||
if (eb) {
|
if (eb) {
|
||||||
e = eb->exts[i];
|
e = eb->exts[i];
|
||||||
if (e->defwrt_type == DEFWRT_NONE)
|
if (!e) {
|
||||||
|
nasm_assert(pass0 == 0);
|
||||||
|
/* Not available - can happen during optimization */
|
||||||
|
return NO_SEG;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (e->defwrt_type) {
|
||||||
|
case DEFWRT_NONE:
|
||||||
return segment; /* fine */
|
return segment; /* fine */
|
||||||
else if (e->defwrt_type == DEFWRT_SEGMENT)
|
case DEFWRT_SEGMENT:
|
||||||
return e->defwrt_ptr.seg->index + 1;
|
return e->defwrt_ptr.seg->index + 1;
|
||||||
else if (e->defwrt_type == DEFWRT_GROUP)
|
case DEFWRT_GROUP:
|
||||||
return e->defwrt_ptr.grp->index + 1;
|
return e->defwrt_ptr.grp->index + 1;
|
||||||
else
|
default:
|
||||||
return NO_SEG; /* can't tell what it is */
|
return NO_SEG; /* can't tell what it is */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return segment; /* not one of ours - leave it alone */
|
return segment; /* not one of ours - leave it alone */
|
||||||
|
|
Loading…
Reference in a new issue