C codegen: emit correct operator instead of placeholder

This commit is contained in:
tocariimaa 2025-01-21 14:35:01 -03:00
parent 319047ccea
commit 53d1825d5b

View file

@ -255,7 +255,7 @@ emit_expr_binop(CodegenC *cgc, const AstBinop *expr)
/* guard binops with parenthesis, even if they are redundant */ /* guard binops with parenthesis, even if they are redundant */
fputc('(', cgc->cgctx->out); fputc('(', cgc->cgctx->out);
emit_expr(cgc, expr->left); emit_expr(cgc, expr->left);
fputc('+', cgc->cgctx->out); fputs((char *)expr->op.s, cgc->cgctx->out);
emit_expr(cgc, expr->right); emit_expr(cgc, expr->right);
fputc(')', cgc->cgctx->out); fputc(')', cgc->cgctx->out);
} }