scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 3618cdb4bcb74744323c340615242234ccf49fa2
parent deed2f68c71afdeb172a8362c6c9d3f3b9f60c4b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 26 Aug 2015 22:28:07 +0200

Do not recover in semantic errors in arithmetic()

There is no need of synchronize with the input, so don't call
error().

Diffstat:
cc1/expr.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cc1/expr.c b/cc1/expr.c @@ -583,7 +583,7 @@ arithmetic(char op, Node *lp, Node *rp) return parithmetic(op, lp, rp); default: incorrect: - error("incorrect arithmetic operands"); + errorp("incorrect arithmetic operands"); } return simplify(op, lp->type, lp, rp); @@ -709,7 +709,7 @@ array(Node *lp, Node *rp) lp = arithmetic(OADD, lp, rp); tp = lp->type; if (tp->op != PTR) - error("subscripted value is neither array nor pointer"); + errorp("subscripted value is neither array nor pointer"); lp = node(OPTR, tp->type, lp, NULL); lp->lvalue = 1; return lp;