cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit bf348610b7e133e7b06b7f0275509d77adf17a38
parent 3556b3d1c8fa6282a0dcc0764e5d8cf619333800
Author: Michael Forney <mforney@mforney.org>
Date:   Tue, 12 Feb 2019 15:32:05 -0800

Fix adding pointer to integer

Diffstat:
Mexpr.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/expr.c b/expr.c @@ -309,6 +309,7 @@ mkbinaryexpr(struct location *loc, enum tokenkind op, struct expression *l, stru r = mkbinaryexpr(loc, TMUL, exprconvert(r, &typeulong), mkconstexpr(&typeulong, t->base->size)); } else if (lp & PROPINT && r->type->kind == TYPEPOINTER) { t = r->type; + l = mkbinaryexpr(loc, TMUL, exprconvert(l, &typeulong), mkconstexpr(&typeulong, t->base->size)); } else { error(loc, "invalid operands to '+' operator"); }