Skip to content

Commit 3d591a7

Browse files
committed
Fix return type detection
1 parent bdfa8e1 commit 3d591a7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cc/backend/codegen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ static size_t alloc_params_onto_stack_frame(Function *func, bool *prequire_stack
858858
const int arg_start = 0;
859859
#else
860860
const Type *rettype = func->type->func.ret;
861-
const int arg_start = is_prim_type(rettype) || is_small_struct(rettype) ? 0 : 1;
861+
const int arg_start = rettype->kind == TY_STRUCT && !is_small_struct(rettype) ? 1 : 0;
862862
#endif
863863
int reg_index[2] = {arg_start, 0}; // [0]=gp-reg, [1]=fp-reg
864864

0 commit comments

Comments
 (0)