aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgbasm5
1 files changed, 4 insertions, 1 deletions
diff --git a/gbasm b/gbasm
index 28b4f2f..2b01a3e 100755
--- a/gbasm
+++ b/gbasm
@@ -372,7 +372,10 @@ def preprocess(input_file, offset):
if ':' in line_without_comment:
splitted = line_without_comment.split(':')
- labels[splitted[0].strip().upper()] = starting_address
+ labelName = splitted[0].strip().upper()
+ if labelName in labels:
+ raise ValueError("Label \"{}\" is already defined".format(labelName))
+ labels[labelName] = starting_address
line_without_comment = splitted[1].strip()
if line_without_comment != '':