Skip to content

Commit 956c274

Browse files
committed
fix printing of indirect function calls
1 parent 2aac758 commit 956c274

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

backends/cpp/cppexpr.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,6 +1607,10 @@ PrintExpr(Flexbuf *f, AST *expr, int flags)
16071607
(*b->printit)(f, b, expr->right);
16081608
} else if (sym->kind == SYM_FUNCTION) {
16091609
PrintFuncCall(f, sym, expr->right, objtype, objref);
1610+
} else if (sym->kind == SYM_VARIABLE) {
1611+
flexbuf_printf(f, "(*%s)(", sym->user_name);
1612+
PrintExprList(f, expr->right, PRINTEXPR_DEFAULT, NULL);
1613+
flexbuf_printf(f, ")");
16101614
} else {
16111615
ERROR(expr, "%s is not a function", sym->user_name);
16121616
}

0 commit comments

Comments
 (0)