labels: if we have overridden EXTERN, don't call define_label()

If we have overridden EXTERN, then we should not call define_label()
on it again.  Return a fail status from declare_label(), indicating
that the type declaration failed, but of course we don't print an
error message.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin, Intel 2018-06-25 13:11:01 -07:00
parent 2139874de2
commit 4fb2acc0d3

View file

@ -398,7 +398,7 @@ static bool declare_label_lptr(union label *lptr,
type == LBL_EXTERN) {
if (!lptr->defn.special)
lptr->defn.special = perm_copy(special);
return true;
return false; /* Don't call define_label() after this! */
}
nasm_error(ERR_NONFATAL, "symbol `%s' declared both as %s and %s",