assembly: fix element duplicate label checking

This commit is contained in:
Zheng, Lei 2018-09-07 14:47:12 +08:00
parent 79614974f6
commit 5b2f28c38b

View File

@ -1886,7 +1886,7 @@ class AsmElementGroup(AsmGroup):
names = set() names = set()
for o in self.Object.Group: for o in self.Object.Group:
if o != obj: if o != obj:
names.add(o.Name) names.add(o.Label)
if label not in names: if label not in names:
return return
for i,c in enumerate(reversed(label)): for i,c in enumerate(reversed(label)):
@ -1897,7 +1897,7 @@ class AsmElementGroup(AsmGroup):
i=0 i=0
while True: while True:
i=i+1; i=i+1;
newLabel = '{}{03d}'.format(label,i); newLabel = '{}{:03d}'.format(label,i);
if newLabel!=obj.Label and newLabel not in names: if newLabel!=obj.Label and newLabel not in names:
return newLabel return newLabel