diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:54:58 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:54:58 +0000 |
commit | ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db (patch) | |
tree | f44620fa214c3d1c4ec5eed664fd538e24832f26 /eval.c | |
parent | 900fa5b26b8f1374416d6dfbdacfed65f10ae5eb (diff) | |
download | nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.tar.gz nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.tar.bz2 nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.zip |
NASM 0.98p3.2
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 29 |
1 files changed, 10 insertions, 19 deletions
@@ -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); |