aboutsummaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/expr.c b/expr.c
index 9437b33..ca0aacd 100644
--- a/expr.c
+++ b/expr.c
@@ -262,7 +262,7 @@ mkbinaryexpr(struct location *loc, enum tokenkind op, struct expr *l, struct exp
if (l->type->kind != TYPEPOINTER || !(rp & PROPINT))
error(loc, "invalid operands to '+' operator");
t = l->type;
- if (t->base->incomplete || !(t->base->prop & PROPOBJECT))
+ if (t->base->incomplete || t->base->kind == TYPEFUNC)
error(loc, "pointer operand to '+' must be to complete object type");
r = mkbinaryexpr(loc, TMUL, exprconvert(r, &typeulong), mkconstexpr(&typeulong, t->base->size));
break;
@@ -273,7 +273,7 @@ mkbinaryexpr(struct location *loc, enum tokenkind op, struct expr *l, struct exp
}
if (l->type->kind != TYPEPOINTER || !(rp & PROPINT) && r->type->kind != TYPEPOINTER)
error(loc, "invalid operands to '-' operator");
- if (l->type->base->incomplete || !(l->type->base->prop & PROPOBJECT))
+ if (l->type->base->incomplete || l->type->base->kind == TYPEFUNC)
error(loc, "pointer operand to '-' must be to complete object type");
if (rp & PROPINT) {
t = l->type;