> @@ -1211,7 +1211,7 @@ check_expr_call(struct context *ctx,> }> }> > - if (param && fntype->func.variadism == VARIADISM_HARE) {> + if (param && param->type->array.members && fntype->func.variadism ==> VARIADISM_HARE) {> // No variadic arguments, lower to empty slice
You've found the right place for a fix, but the fix is not correct.
param->type may not be an array, and reading param->type->array.members isn't
valid in that case. I think what we really want to check here is that the param
we're looking at is the last one, so perhaps condition like
`if (param && !param->next && fntype->func.variadism == VARIADISM_HARE)` would
be worth trying out.
On Sat Jun 4, 2022 at 6:59 AM EDT, Bor Grošelj Simić wrote:
> > @@ -1211,7 +1211,7 @@ check_expr_call(struct context *ctx,> > }> > }> > > > - if (param && fntype->func.variadism == VARIADISM_HARE) {> > + if (param && param->type->array.members && fntype->func.variadism ==> > VARIADISM_HARE) {> > // No variadic arguments, lower to empty slice>> You've found the right place for a fix, but the fix is not correct.> param->type may not be an array, and reading param->type->array.members isn't> valid in that case. I think what we really want to check here is that the param> we're looking at is the last one, so perhaps condition like> `if (param && !param->next && fntype->func.variadism == VARIADISM_HARE)` would> be worth trying out.
Thanks, that seems to work. And it matches the condition used in the
loop above this section. Sending a v2 shortly.