summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-04-30 20:54:58 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-04-30 20:54:58 +0000
commitce14ce6fc4bf6a8a73bd7061177f8dfa696b37db (patch)
treef44620fa214c3d1c4ec5eed664fd538e24832f26 /eval.c
parent900fa5b26b8f1374416d6dfbdacfed65f10ae5eb (diff)
downloadnasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.tar.gz
nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.tar.bz2
nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.zip
NASM 0.98p3.2
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/eval.c b/eval.c
index 6dd3f4d..a44ff7b 100644
--- a/eval.c
+++ b/eval.c
@@ -698,33 +698,24 @@ static expr *expr6(int critical)
break;
}
- /*
- * Since the whole line is parsed before the label it
- * defines is given to the label manager, we have
- * problems with lines such as
- *
- * end: TIMES 512-(end-start) DB 0
- *
- * where `end' is not known on pass one, despite not
- * really being a forward reference, and due to
- * criticality it is _needed_. Hence we check our label
- * against the currently defined one, and do our own
- * resolution of it if we have to.
- */
type = EXPR_SIMPLE; /* might get overridden by UNKNOWN */
- if (i == TOKEN_BASE) {
+ if (i == TOKEN_BASE)
+ {
label_seg = location->segment;
label_ofs = 0;
} else if (i == TOKEN_HERE) {
label_seg = location->segment;
label_ofs = location->offset;
- } else if (!labelfunc(tokval->t_charptr,&label_seg,&label_ofs)) {
+ } else {
+ if (!labelfunc(tokval->t_charptr,&label_seg,&label_ofs))
+ {
if (critical == 2) {
error (ERR_NONFATAL, "symbol `%s' undefined",
tokval->t_charptr);
return NULL;
} else if (critical == 1) {
- error (ERR_NONFATAL, "symbol `%s' not defined before use",
+ error (ERR_NONFATAL,
+ "symbol `%s' not defined before use",
tokval->t_charptr);
return NULL;
} else {
@@ -735,12 +726,12 @@ static expr *expr6(int critical)
label_ofs = 1;
}
}
- addtotemp(type, label_ofs);
- if (label_seg!=NO_SEG) {
- addtotemp(EXPR_SEGBASE + label_seg, 1L);
if (opflags && is_extern (tokval->t_charptr))
*opflags |= OPFLAG_EXTERN;
}
+ addtotemp(type, label_ofs);
+ if (label_seg!=NO_SEG)
+ addtotemp(EXPR_SEGBASE + label_seg, 1L);
break;
}
i = scan(scpriv, tokval);