[util] Allow "any type" results for cexpr

Setting the result type cexpr_exprval tells cexpr to simply return whoe
exprval object rather than the referenced value, thus allowing the
caller to check the type when the expression is context sensitive.
This commit is contained in:
Bill Currie 2021-02-09 19:30:30 +09:00
parent 35f12c36ff
commit 55104ac430

View file

@ -191,6 +191,10 @@ assign_expr (exprval_t *dst, const exprval_t *src, exprctx_t *context)
if (!src) {
return;
}
if (dst->type == &cexpr_exprval) {
*(exprval_t **) dst->value = (exprval_t *) src;
return;
}
binop = cexpr_find_cast (dst->type, src->type);
if (binop && binop->op) {
binop->func (dst, src, dst, context);