Skip to content

Commit

Permalink
Fix issue #360.
Browse files Browse the repository at this point in the history
  • Loading branch information
vnmakarov committed Aug 8, 2023
1 parent 4c7f488 commit e652044
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions c-tests/new/issue360.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
struct F00 {
int a;
};
struct F00 func () = func ();
1 change: 1 addition & 0 deletions c-tests/new/issue360.c.expectrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
3 changes: 2 additions & 1 deletion c2mir/c2mir.c
Original file line number Diff line number Diff line change
Expand Up @@ -9308,7 +9308,8 @@ static void check (c2m_ctx_t c2m_ctx, node_t r, node_t context) {
}
if (ret_type->mode == TM_STRUCT || ret_type->mode == TM_UNION) {
set_type_layout (c2m_ctx, ret_type);
if (!builtin_call_p) update_call_arg_area_offset (c2m_ctx, ret_type, TRUE);
if (!builtin_call_p && curr_scope != top_scope)
update_call_arg_area_offset (c2m_ctx, ret_type, TRUE);
}
if (builtin_call_p && !jcall_p) break;
first_arg = jcall_p ? NL_EL (arg_list->u.ops, 1) : NL_HEAD (arg_list->u.ops);
Expand Down

0 comments on commit e652044

Please sign in to comment.