diff --git a/c-tests/new/issue360.c b/c-tests/new/issue360.c new file mode 100644 index 0000000000..e2f7380ad2 --- /dev/null +++ b/c-tests/new/issue360.c @@ -0,0 +1,4 @@ +struct F00 { + int a; +}; +struct F00 func () = func (); diff --git a/c-tests/new/issue360.c.expectrc b/c-tests/new/issue360.c.expectrc new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/c-tests/new/issue360.c.expectrc @@ -0,0 +1 @@ +1 diff --git a/c2mir/c2mir.c b/c2mir/c2mir.c index 80af0d7095..75e381c2f9 100644 --- a/c2mir/c2mir.c +++ b/c2mir/c2mir.c @@ -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);