diff options
author | Charles Crayne <chuck@thor.crayne.org> | 2008-03-12 22:39:03 -0700 |
---|---|---|
committer | Charles Crayne <chuck@thor.crayne.org> | 2008-03-12 22:39:03 -0700 |
commit | d60059ef41829dc9c26241541f9889e9ef7f212d (patch) | |
tree | 59b47a11b050be3fe534440ce74ec9c08f4ddb2f /eval.c | |
parent | aed5cfea58eaa66417e21fdbe49e891ced374ed9 (diff) | |
download | nasm-d60059ef41829dc9c26241541f9889e9ef7f212d.tar.gz nasm-d60059ef41829dc9c26241541f9889e9ef7f212d.tar.bz2 nasm-d60059ef41829dc9c26241541f9889e9ef7f212d.zip |
Display fully qualified local label in "not defined" message
Add new function "local_scope" to label subsystem to
return the previous non-local label for a given local label,
and invoke this funcion in eval.c to display the fully
qualified name in the "not defined" error message.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -668,6 +668,7 @@ static expr *expr6(int critical) expr *e; int32_t label_seg; int64_t label_ofs; + char *scope; switch (i) { case '-': @@ -783,14 +784,15 @@ static expr *expr6(int critical) label_ofs = in_abs_seg ? abs_offset : location->offset; } else { if (!labelfunc(tokval->t_charptr, &label_seg, &label_ofs)) { + scope = local_scope(tokval->t_charptr); if (critical == 2) { - error(ERR_NONFATAL, "symbol `%s' undefined", - tokval->t_charptr); + error(ERR_NONFATAL, "symbol `%s%s' undefined", + scope,tokval->t_charptr); return NULL; } else if (critical == 1) { error(ERR_NONFATAL, - "symbol `%s' not defined before use", - tokval->t_charptr); + "symbol `%s%s' not defined before use", + scope,tokval->t_charptr); return NULL; } else { if (opflags) |