Recursively add offsets of Struct.field_from_path()
This commit is contained in:
@@ -160,9 +160,6 @@ class Struct:
|
||||
raise KeyError('%r has no field %r, only %r' %
|
||||
(self, name, sorted(self._fields_by_name.keys())))
|
||||
|
||||
if name_tail:
|
||||
return field.dna_type.field_from_path(pointer_size, name_tail)
|
||||
|
||||
offset = field.offset
|
||||
if index:
|
||||
if field.name.is_pointer:
|
||||
@@ -174,6 +171,10 @@ class Struct:
|
||||
(path, field.dna_type))
|
||||
offset += index_offset
|
||||
|
||||
if name_tail:
|
||||
subval, suboff = field.dna_type.field_from_path(pointer_size, name_tail)
|
||||
return subval, suboff + offset
|
||||
|
||||
return field, offset
|
||||
|
||||
def field_get(self,
|
||||
|
||||
Reference in New Issue
Block a user