commit db5bb1c936717b9930d1af702e9978ebf7fed9d6
parent ea119e788773884b379e2fb05af37280c16d6f68
Author: Drew DeVault <sir@cmpwn.com>
Date: Sat, 4 Sep 2021 07:43:10 +0200
struct_subtype: add recursion
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/types.c b/src/types.c
@@ -535,7 +535,8 @@ struct_subtype(const struct type *to, const struct type *from) {
for (struct struct_field *f = from->struct_union.fields; f;
f = f->next) {
if (f->offset == 0) {
- return f->type == to;
+ return f->type == to
+ || struct_subtype(to, type_dealias(f->type));
}
}
return false;