Merge pull request #215 from Daniel-Cortez/lbl_redef_fix

Do not allow to redefine labels
This commit is contained in:
Zeex 2017-12-17 13:57:33 +06:00 committed by GitHub
commit 0533717bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5837,6 +5837,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