aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-10-03 23:37:31 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-10-03 23:37:31 +0300
commitbcd443509307a6129f5db4b95c679c0323e5ab83 (patch)
treec9043bf526f3287cee93464e961b0e178d6850a6
parent7000f1a6656e88961aadfa383f884ffbf3991498 (diff)
downloadmailfromd-bcd443509307a6129f5db4b95c679c0323e5ab83.tar.gz
mailfromd-bcd443509307a6129f5db4b95c679c0323e5ab83.tar.bz2
Bugfixes.
* mfd/gram.y: Remove calls to add_xref. * mfd/lex.l (variable_or_const): Call add_xref before returning a constant. (print_parse_message): Bugfix: pass argument to mu_error via "%s", to avoid interpretation of % sequences in the formatted message. * mfd/prog.h (add_xref): New proto.
-rw-r--r--mfd/gram.y4
-rw-r--r--mfd/lex.l5
-rw-r--r--mfd/prog.h1
3 files changed, 4 insertions, 6 deletions
diff --git a/mfd/gram.y b/mfd/gram.y
index 570d4eac..0e36c0f7 100644
--- a/mfd/gram.y
+++ b/mfd/gram.y
@@ -44,7 +44,6 @@ static NODE *declare_function(struct function *func, struct locus *loc,
static data_type_t node_type(NODE *node);
static NODE *cast_arg_list(NODE *args, size_t parmc, data_type_t *parmtype,
int disable_prom);
-static void add_xref(struct variable *var, const struct locus *locus);
static struct variable *vardecl(const char *name, data_type_t type,
storage_class_t sc, struct locus *loc);
static struct variable *externdecl(const char *name, struct value *value,
@@ -2068,9 +2067,6 @@ arglist : expr
;
variable : T_VARIABLE
- {
- add_xref($1, get_locus());
- }
| T_BOGUS
{
YYERROR;
diff --git a/mfd/lex.l b/mfd/lex.l
index df076b25..38048cb3 100644
--- a/mfd/lex.l
+++ b/mfd/lex.l
@@ -261,7 +261,8 @@ variable_or_const()
parse_error(_("Variable %s is not defined"),
yylval.literal->text);
return T_BOGUS;
- }
+ }
+ add_xref(vptr, &locus);
yylval.var = vptr;
return T_VARIABLE;
}
@@ -1021,7 +1022,7 @@ print_parse_message(const struct locus *locus,
if (prefix)
n += snprintf(buf + n, sizeof buf - n, "%s: ", prefix);
vsnprintf(buf + n, sizeof buf - n, gettext(fmt), ap);
- mu_error(buf);
+ mu_error("%s", buf);
}
void
diff --git a/mfd/prog.h b/mfd/prog.h
index 995b26bb..475c19b0 100644
--- a/mfd/prog.h
+++ b/mfd/prog.h
@@ -79,6 +79,7 @@ NODE *create_node_arg(long num, const struct locus *locus);
NODE *create_node_symbol(struct literal *lit, const struct locus *loc);
NODE *create_node_backref(long num, const struct locus *locus);
NODE *cast_to(data_type_t type, NODE *node);
+void add_xref(struct variable *var, const struct locus *locus);
extern instr_t *prog;
extern unsigned error_count;

Return to:

Send suggestions and report system problems to the System administrator.