From 401b29f4641992a1c98aacb7c4d3787ac79c3ba4 Mon Sep 17 00:00:00 2001 From: Daniel_Cortez Date: Sat, 2 Dec 2017 19:08:31 +0700 Subject: [PATCH] Do not allow to redefine the same label --- source/compiler/sc1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index e77b64c..b1e2108 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -5820,6 +5820,8 @@ static void dolabel(void) if (find_constval(&tagname_tab,st,0)!=NULL) error(221,st); /* label name shadows tagname */ sym=fetchlab(st); + if ((sym->usage & uDEFINE)!=0) + error(21,st); /* symbol already defined */ setlabel((int)sym->addr); /* since one can jump around variable declarations or out of compound * blocks, the stack must be manually adjusted