scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 13fc67fc4de717eae74ff53404f762abc74fc754
parent 70d8b2ec0842c164102d6c9e2d11362ded79dde3
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 30 Sep 2016 10:52:31 +0200

[cc1] Calls to eqtype() in parithmetic()

Eqtype() covers all the cases of equality and having all the comparisions
centered will make easier to change the equality terms in the future

Diffstat:
Mcc1/expr.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/expr.c b/cc1/expr.c @@ -309,7 +309,7 @@ parithmetic(char op, Node *lp, Node *rp) size = sizeofnode(tp->type); if (op == OSUB && BTYPE(rp) == PTR) { - if (tp != rp->type) + if (!eqtype(tp, rp->type, 0)) goto incorrect; lp = node(OSUB, pdifftype, lp, rp); return node(ODIV, inttype, lp, size);