diff options
author | Ian C <ianc@noddybox.co.uk> | 2018-09-18 14:41:06 +0100 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2018-09-18 14:41:06 +0100 |
commit | 28bbe2acbd0064769be2f8efc7f64f05ba1e321e (patch) | |
tree | b0241903303b01b4ccba7fa582c9ffc4679842a4 /src | |
parent | b442eb4bbab3820ce6bc0b2551c1c560c2911c43 (diff) |
Made it so duplicating a label is an error.
Diffstat (limited to 'src')
-rw-r--r-- | src/casm.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -892,6 +892,28 @@ static void RunPass(const char *name, FILE *fp, int depth) goto error_handling; } + if (IsFirstPass()) + { + const Label *l; + + if ((l = LabelFind(label, type))) + { + if (l->type == GLOBAL_LABEL) + { + snprintf(err, sizeof err, "Global %s already defined", + label); + } + else + { + snprintf(err, sizeof err, "Local %s already defined", + label); + } + + cmdstat = CMD_FAILED; + goto error_handling; + } + } + /* This may well be updated by a command, but easier to set anyway */ if (options.address24) |