Skip to content

Commit

Permalink
Process special case of anon struct for riscv64 in small_struct_p.
Browse files Browse the repository at this point in the history
  • Loading branch information
vnmakarov committed May 10, 2024
1 parent 62c4ece commit 5ce509e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion c2mir/riscv64/criscv64-ABI-code.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ static int small_struct_p (c2m_ctx_t c2m_ctx, struct type *type, int struct_only
el = NL_NEXT (el))
if (el->code == N_MEMBER) {
decl_t decl = el->attr;
mir_size_t member_offset = decl->offset;

if (decl->width == 0) continue;
if (!small_struct_p (c2m_ctx, decl->decl_spec.type, FALSE, decl->offset + start_offset,
if (decl->containing_unnamed_anon_struct_union_member != NULL) {
member_offset = 0;
}
if (!small_struct_p (c2m_ctx, decl->decl_spec.type, FALSE, member_offset + start_offset,
&sub_n, sub_members))
return FALSE;
if (sub_n + *members_n > 2) return FALSE;
Expand Down

0 comments on commit 5ce509e

Please sign in to comment.