From ddbd42e66cc71b470730037d76f4f267e98d8d40 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 13 Apr 2026 19:25:11 +0200 Subject: C99 complex types MVP Missing: static eval of complex values, Silly inefficient implementation of equality comparisons between them The whole thing is pretty inefficient without proper aggregate mem2reg anyway --- src/c_builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/c_builtin.c') diff --git a/src/c_builtin.c b/src/c_builtin.c index 522c4dc..79bdcc7 100644 --- a/src/c_builtin.c +++ b/src/c_builtin.c @@ -147,7 +147,7 @@ Ref builtin_va_arg_comp(Function *fn, const Expr *ex, bool discard) { assert(ex->t == EVAARG && ex->ty.t); - enum irclass k = isagg(ex->ty) ? KPTR : type2cls[scalartypet(ex->ty)]; + enum irclass k = (isagg(ex->ty) || iscomplex(ex->ty)) ? KPTR : type2cls[scalartypet(ex->ty)]; return addinstr(fn, mkinstr2(Ovaarg, k, compileexpr(fn, ex->sub, 0), mktyperef(mkirtype(ex->ty)))); } -- cgit v1.2.3