aboutsummaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-19 17:49:43 -0800
committerMichael Forney <mforney@mforney.org>2019-02-19 17:49:43 -0800
commitf326044f9fc4ef7e182603e8686dde3f12da42dd (patch)
tree501aa8008e0f3bbdbcdb207d75aba6d0eba9f9f5 /expr.c
parent5e668f124cdaccb38cf2a879ccf456c971743136 (diff)
Implement __builtin_va_copy
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/expr.c b/expr.c
index 13e7533..78881fb 100644
--- a/expr.c
+++ b/expr.c
@@ -453,6 +453,13 @@ postfixexpr(struct scope *s, struct expression *r)
expect(TCOMMA, "after va_list");
e->type = typename(s);
expect(TRPAREN, "after typename");
+ } else if (r->ident.decl == &builtinvacopy) {
+ e = mkexpr(EXPRASSIGN, typevalist.base, 0);
+ e->assign.l = mkunaryexpr(TMUL, exprconvert(assignexpr(s), &typevalistptr));
+ expect(TCOMMA, "after target va_list");
+ e->assign.r = mkunaryexpr(TMUL, exprconvert(assignexpr(s), &typevalistptr));
+ expect(TRPAREN, "after source va_list");
+ e = exprconvert(e, &typevoid);
} else if (r->ident.decl == &builtinvaend) {
e = mkexpr(EXPRBUILTIN, &typevoid, 0);
e->builtin.kind = BUILTINVAEND;