m1n1.constructutils: Optionally do not recurse through pointers

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2022-08-17 13:22:18 +09:00
parent 203c0135e7
commit 1fcfa3d0e3

View file

@ -358,6 +358,13 @@ class ROPointer(Pointer):
def _build(self, obj, stream, context, path):
return obj
def _parse(self, stream, context, path):
recurse = getattr(stream, "recurse", False)
if not recurse:
return None
return Pointer._parse(self, stream, context, path)
class ConstructClass(ConstructClassBase, Container):
""" Offers two benifits over regular construct