summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-10-01 16:39:37 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-10-01 16:39:37 +0200
commitd0a07491e459c33273a2efeaf403851c5df4e39d (patch)
tree60577b687cc553e0d2506114737be3237c7f4c93
parent846682b6ba593fd73a286425026d9fe92830eba8 (diff)
downloadmdk-d0a07491e459c33273a2efeaf403851c5df4e39d.tar.gz
mdk-d0a07491e459c33273a2efeaf403851c5df4e39d.tar.bz2
Fix for #23816: missing symbol name in EQU is now just a warning.
-rw-r--r--mixlib/mix_parser.c10
-rw-r--r--mixlib/mix_scanner.l24
2 files changed, 22 insertions, 12 deletions
diff --git a/mixlib/mix_parser.c b/mixlib/mix_parser.c
index 142b245..796f3ad 100644
--- a/mixlib/mix_parser.c
+++ b/mixlib/mix_parser.c
@@ -2,7 +2,7 @@
* Implementation of the functions declared in mix_parser.h and
* xmix_parser.h
* ------------------------------------------------------------------
- * Copyright (C) 2000, 2001, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2000, 2001, 2003, 2004, 2006, 2007, 2009 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -467,13 +467,15 @@ mix_parser_err_t
mix_parser_define_symbol_value (mix_parser_t *parser, const gchar *name,
mix_word_t value)
{
- g_assert (parser != NULL && name != NULL);
+ g_assert (parser != NULL);
+
+ if (NULL == name || strlen (name) == 0) return MIX_PERR_MIS_SYM;
switch (mix_symbol_table_add (parser->symbol_table, name, value))
{
case MIX_SYM_OK:
- if ( parser->status == MIX_PERR_NOCOMP )
- update_future_refs_value_ (parser, name, value, TRUE);
+ if (parser->status == MIX_PERR_NOCOMP)
+ update_future_refs_value_ (parser, name, value, TRUE);
return MIX_PERR_OK;
case MIX_SYM_LONG: return MIX_PERR_LONG_SYMBOL;
case MIX_SYM_DUP: return MIX_PERR_DUP_SYMBOL;
diff --git a/mixlib/mix_scanner.l b/mixlib/mix_scanner.l
index 9ced144..aeff30a 100644
--- a/mixlib/mix_scanner.l
+++ b/mixlib/mix_scanner.l
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mix_scanner.l :
* Lexical scanner used by mix_parser_t
* ------------------------------------------------------------------
- * Copyright (C) 2000, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+ * Copyright (C) 2000, 2003, 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -329,13 +329,21 @@ wexpr {expr}({fpart})?(,{expr}({fpart})?)*
<EQU>{
{number}{ws}*\n |
{number}{ws}+.*\n {
- mix_word_t value;
- gint def;
- if ( symbol == NULL ) RETURN_ERROR (MIX_PERR_MIS_SYM, NULL);
- value = mix_word_new (atol (yytext));
- def = mix_parser_define_symbol_value (parser, symbol, value);
- if ( def == MIX_SYM_DUP ) RETURN_ERROR (MIX_PERR_DUP_SYMBOL, symbol);
- if ( def == MIX_SYM_LONG ) RETURN_ERROR (MIX_PERR_LONG_SYMBOL, symbol);
+ gint def = MIX_PERR_MIS_SYM;
+ if (symbol)
+ {
+ mix_word_t value = mix_word_new (atol (yytext));
+ def = mix_parser_define_symbol_value (parser, symbol, value);
+ }
+ switch (def)
+ {
+ case MIX_SYM_DUP: RETURN_ERROR (MIX_PERR_DUP_SYMBOL, symbol); break;
+ case MIX_SYM_LONG: RETURN_ERROR (MIX_PERR_LONG_SYMBOL, symbol); break;
+ case MIX_PERR_MIS_SYM:
+ mix_parser_log_error (parser, def, lineno, NULL, TRUE);
+ break;
+ default: break;
+ }
++lineno;
BEGIN (INITIAL);
}