1.1 --- a/transresults.py Sat Sep 02 01:19:52 2023 +0200
1.2 +++ b/transresults.py Sat Sep 02 01:48:44 2023 +0200
1.3 @@ -109,14 +109,14 @@
1.4 # Qualified names must be converted into parent-relative assignments.
1.5
1.6 elif self.parent:
1.7 - return "__store_via_object(&%s, %s, %s)" % (
1.8 + return "__store_via_attr_ref(__get_object_attr_ref(&%s, %s), %s)" % (
1.9 encode_path(self.parent), self.attrname, self.expr)
1.10
1.11 # All other assignments involve the names as they were given.
1.12 # To support value replacement, a special operation is used.
1.13
1.14 else:
1.15 - return "__set_local(&%s, %s)" % (self.attrname, self.expr)
1.16 + return "__set_attr(&%s, %s)" % (self.attrname, self.expr)
1.17
1.18 # Expressions.
1.19
1.20 @@ -179,7 +179,8 @@
1.21 "A translation result for an attribute access."
1.22
1.23 def __init__(self, instructions, refs, location, context_identity,
1.24 - context_identity_verified, accessor_test, accessor_stored):
1.25 + context_identity_verified, accessor_test, accessor_stored,
1.26 + attribute_ref_stored):
1.27
1.28 InstructionSequence.__init__(self, instructions)
1.29 self.refs = refs
1.30 @@ -188,6 +189,7 @@
1.31 self.context_identity_verified = context_identity_verified
1.32 self.accessor_test = accessor_test
1.33 self.accessor_stored = accessor_stored
1.34 + self.attribute_ref_stored = attribute_ref_stored
1.35
1.36 def references(self):
1.37 return self.refs
1.38 @@ -207,6 +209,9 @@
1.39 def stores_accessor(self):
1.40 return self.accessor_stored
1.41
1.42 + def stores_attribute_ref(self):
1.43 + return self.attribute_ref_stored
1.44 +
1.45 def get_origin(self):
1.46 return self.refs and len(self.refs) == 1 and first(self.refs).get_origin()
1.47
1.48 @@ -225,10 +230,11 @@
1.49 return encode_instructions(self.instructions)
1.50
1.51 def __repr__(self):
1.52 - return "AttrResult(%r, %r, %r, %r, %r, %r, %r)" % (
1.53 + return "AttrResult(%r, %r, %r, %r, %r, %r, %r, %r)" % (
1.54 self.instructions, self.refs, self.location,
1.55 self.context_identity, self.context_identity_verified,
1.56 - self.accessor_test, self.accessor_stored)
1.57 + self.accessor_test, self.accessor_stored,
1.58 + self.attribute_ref_stored)
1.59
1.60 class AliasResult(NameRef, Result):
1.61