summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-10-08 23:56:41 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-10-08 23:56:41 (GMT)
commitcb05b99a8c451ff80d88f988e2654c794b0f3750 (patch)
tree0845dc11c6ec32765f8f6a08b740ff8b5e804894
parentb0f5ae703f50b182e5cb28455b549804cc37fb40 (diff)
Try to resolve more Kaitai subtypes.
-rw-r--r--plugins/kaitai/parsers/struct.c3
-rw-r--r--plugins/kaitai/scope.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/plugins/kaitai/parsers/struct.c b/plugins/kaitai/parsers/struct.c
index 07126c6..f23a264 100644
--- a/plugins/kaitai/parsers/struct.c
+++ b/plugins/kaitai/parsers/struct.c
@@ -684,6 +684,9 @@ GKaitaiType *g_kaitai_structure_find_sub_type(const GKaitaiStruct *kstruct, cons
break;
}
+ result = g_kaitai_structure_find_sub_type(G_KAITAI_STRUCT(kstruct->types[i]), name);
+ if (result != NULL) break;
+
}
return result;
diff --git a/plugins/kaitai/scope.c b/plugins/kaitai/scope.c
index 6d1d47a..fad8890 100644
--- a/plugins/kaitai/scope.c
+++ b/plugins/kaitai/scope.c
@@ -231,7 +231,7 @@ GKaitaiType *find_sub_type(const kaitai_scope_t *locals, const char *name)
size_t i; /* Boucle de parcours */
GKaitaiParser *parser; /* Lecteur d'origine */
- GMatchRecord *list[] = { locals->root, locals->parent, locals->last };
+ GMatchRecord *list[] = { locals->last, locals->parent, locals->root };
result = NULL;