summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--simplex86.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/simplex86.c b/simplex86.c
index c1ced11..b891ab7 100644
--- a/simplex86.c
+++ b/simplex86.c
@@ -1252,8 +1252,17 @@ gather_labels (array_t *a)
if (label->type == LABEL)
{
uint32_t idx = hash (label->name);
- while (hash_table[idx & mask])
- idx++;
+ annotation_t *existing;
+
+ while ((existing = hash_table[idx & mask]))
+ {
+ if (strcmp (existing->name, label->name) == 0)
+ {
+ printf ("Duplicate label %s\n", label->name);
+ abort ();
+ }
+ idx++;
+ }
hash_table[idx & mask] = label;
}