Skip to content

Commit

Permalink
Only Skip typedefs already printed when printing a dynType.
Browse files Browse the repository at this point in the history
  • Loading branch information
PengZheng committed Jan 10, 2024
1 parent 1ff4bc1 commit 0bde38e
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions libs/dfi/src/dyn_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,8 @@ static void dynType_printComplex(const char* name, const dyn_type* type, int dep

static void dynType_printSequence(const char* name, const dyn_type* type, int depth, FILE* stream) {
dynType_printDepth(depth, stream);
fprintf(stream, "%s: sequence, size is %zu, alignment is %i, descriptor is '%c'. fields:\n",
name, type->ffiType->size, type->ffiType->alignment, type->descriptor);
fprintf(stream, "sequence, size is %zu, alignment is %i, descriptor is '%c'. fields:\n",
type->ffiType->size, type->ffiType->alignment, type->descriptor);

dynType_printDepth(depth + 1, stream);
fprintf(stream, "cap: simple type, size is %zu, alignment is %i.\n",
Expand Down Expand Up @@ -999,7 +999,20 @@ static void dynType_printText(const char* name, const dyn_type* type, int depth,

static void dynType_printTypes(const dyn_type* type, FILE* stream) {
if (type->type == DYN_TYPE_REF) {
return;
const dyn_type* real = type->ref.ref;
while (real->type == DYN_TYPE_REF) {
real = real->ref.ref;
}
dyn_type* parent = type->parent;
struct type_entry* pentry = NULL;
while (parent != NULL) {
TAILQ_FOREACH(pentry, &parent->nestedTypesHead, entries) {
if (pentry->type == real) {
return;
}
}
parent = parent->parent;
}
}

struct type_entry* entry = NULL;
Expand Down

0 comments on commit 0bde38e

Please sign in to comment.