[qfcc] Check return value for null in has_function_call

Avoids a segfault when dagging. I'm not sure how a switch statement got
into the dags, but still don't want a segfault there.
This commit is contained in:
Bill Currie 2025-01-18 15:23:37 +09:00
parent 8d69dd85eb
commit 3881147210

View file

@ -1943,6 +1943,10 @@ has_function_call (const expr_t *e)
// in is just a cast of out, if it's not null // in is just a cast of out, if it's not null
return has_function_call (e->inout.out); return has_function_call (e->inout.out);
case ex_return: case ex_return:
if (!e->retrn.ret_val) {
// if there's no return value, can't possibly have a call
return false;
}
return has_function_call (e->retrn.ret_val); return has_function_call (e->retrn.ret_val);
case ex_horizontal: case ex_horizontal:
return has_function_call (e->hop.vec); return has_function_call (e->hop.vec);