summaryrefslogtreecommitdiff
path: root/python/examples/refcounting/dietpass
diff options
context:
space:
mode:
Diffstat (limited to 'python/examples/refcounting/dietpass')
-rwxr-xr-xpython/examples/refcounting/dietpass6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/examples/refcounting/dietpass b/python/examples/refcounting/dietpass
index 9a7b0e8..9d6a77f 100755
--- a/python/examples/refcounting/dietpass
+++ b/python/examples/refcounting/dietpass
@@ -67,8 +67,10 @@ def ptr_exprs(name, ty):
elif isinstance(ty, (BasicType, FunctionType)):
return []
elif isinstance(ty, ArrayType):
- # TODO
- return []
+ result = []
+ for i in range(int(ty.length)):
+ result.extend(ptr_exprs(f"(({name})[{i}])", ty.base))
+ return result
else:
print(ty.classify(), file=sys.stderr)
raise NotImplementedError
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback