From 49812ba3b583294d098b07e92d22ace5f25cb2b4 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Sat, 13 Apr 2019 08:13:33 +0800 Subject: [PATCH] assembly: fix AsmElement.make() Fixes #230 --- assembly.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/assembly.py b/assembly.py index 9169633..28fdbc5 100644 --- a/assembly.py +++ b/assembly.py @@ -833,14 +833,15 @@ class AsmElement(AsmBase): # This give us reference to child assembly's immediate child # without trailing dot. - prefix = subname[:-len(ret.Subname)+1] + prefix = subname[:-len(ret.Subname)-1] - # Pop the immediate child name, and replace it with child - # assembly's element group name - prefix = prefix[:prefix.rfind('.')+1] + \ - resolveAssembly(ret.Assembly).getElementGroup().Name + # Pop the immediate child name + prefix = prefix[:prefix.rfind('.')] - subname = '{}.${}.'.format(prefix,element.Label) + # Finally, generate the subname, by combining the prefix with + # the element group index (i.e. the 1 below) and the linked + # element label + subname = '{}.1.${}.'.format(prefix,element.Label) else: raise RuntimeError('Invalid selection {}.{}'.format(