diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2004-06-22 18:12:18 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2004-06-22 18:12:18 +0000 |
commit | 94eec3ea99992917d081978a4548c961af6ecb64 (patch) | |
tree | ac070e67004cdfef8b4b3277a1d8113b5a0f3859 | |
parent | d4a4ed105bcea3aef11198b023000666dd987df6 (diff) | |
download | mdk-94eec3ea99992917d081978a4548c961af6ecb64.tar.gz mdk-94eec3ea99992917d081978a4548c961af6ecb64.tar.bz2 |
do not store bogus line number for added CON instructions.
-rw-r--r-- | mixlib/mix_parser.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/mixlib/mix_parser.c b/mixlib/mix_parser.c index e70c48e..2a5d29f 100644 --- a/mixlib/mix_parser.c +++ b/mixlib/mix_parser.c @@ -183,15 +183,13 @@ mix_parser_delete (mix_parser_t *parser) } /* Compile a mix source file */ -static guint +static void update_future_refs_value_ (mix_parser_t *parser, const gchar *name, mix_short_t value, gboolean remove) { GSList *list = NULL; gpointer *plist = (gpointer *)(&list); gpointer key; - guint line = 0; - g_assert (parser != NULL && name != NULL); if ( g_hash_table_lookup_extended (parser->future_refs, name, &key, plist) ) @@ -211,8 +209,6 @@ update_future_refs_value_ (mix_parser_t *parser, const gchar *name, } mix_word_add_address (node->ins, value); g_tree_insert (parser->ins_table, tmp->data, (gpointer)node); - /* record the first line the ref appears */ - if (line == 0 || line > node->lineno) line = node->lineno; tmp = g_slist_next (tmp); } if (remove) { @@ -221,7 +217,6 @@ update_future_refs_value_ (mix_parser_t *parser, const gchar *name, } g_slist_free (list); } - return line; } #define update_future_refs_(parser,name,rem) \ @@ -235,8 +230,8 @@ update_ls_ (gpointer symbol, gpointer value, gpointer parser) mix_parser_t *par = (mix_parser_t *) parser; mix_word_to_ins_uncheck (w, ins); - mix_parser_add_ins (par, &ins, - update_future_refs_ (par, (const gchar *)symbol, TRUE)); + update_future_refs_ (par, (const gchar *)symbol, TRUE); + mix_parser_add_ins (par, &ins, 0); par->loc_count++; } @@ -250,7 +245,8 @@ undef_warning_ (gpointer symbol, gpointer value, gpointer data) mix_parser_log_error (parser, MIX_PERR_UNDEF_SYM, 0, name, TRUE); mix_word_to_ins_uncheck (MIX_WORD_ZERO, ins); - mix_parser_add_ins (parser, &ins, update_future_refs_ (parser, name, FALSE)); + update_future_refs_ (parser, name, FALSE); + mix_parser_add_ins (parser, &ins, 0); mix_symbol_table_insert (parser->symbol_table, name, mix_short_to_word_fast (parser->loc_count)); |