diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-10-03 23:37:31 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-10-03 23:37:31 +0300 |
commit | bcd443509307a6129f5db4b95c679c0323e5ab83 (patch) | |
tree | c9043bf526f3287cee93464e961b0e178d6850a6 | |
parent | 7000f1a6656e88961aadfa383f884ffbf3991498 (diff) | |
download | mailfromd-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.y | 4 | ||||
-rw-r--r-- | mfd/lex.l | 5 | ||||
-rw-r--r-- | mfd/prog.h | 1 |
3 files changed, 4 insertions, 6 deletions
@@ -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; @@ -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 @@ -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; |