summaryrefslogtreecommitdiffhomepage
path: root/mixlib
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2004-06-22 18:12:18 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2004-06-22 18:12:18 +0000
commitac4f899dcb82f07a51c70d6aab3583c3377727d0 (patch)
treec75936a43734d081b2b9e58c813afe3b9b18c487 /mixlib
parent12efdfc121b6a465a541be390b6915bdfa27ee43 (diff)
downloadmdk-ac4f899dcb82f07a51c70d6aab3583c3377727d0.tar.gz
mdk-ac4f899dcb82f07a51c70d6aab3583c3377727d0.tar.bz2
do not store bogus line number for added CON instructions.
Diffstat (limited to 'mixlib')
-rw-r--r--mixlib/mix_parser.c14
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));