ref: 4245cbfab4b58fc0c0ab667fb2bc66c411963d0c
parent: 29ceb0ed7c98fa120b8421aafe1babd0baa95c69
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Apr 10 04:46:15 EDT 2014
Check types in relational operators in pointers Before this commit relational() was using bincode(), so there was no any check of the types of the operands. With this new change relational() does the same than eq().
--- a/expr.c
+++ b/expr.c
@@ -95,7 +95,8 @@
case PTR: case ARY:
pointer:
switch (op) {
- case OEQ: case ONE:
+ case OLT: case OGT: case OGE:
+ case OLE: case OEQ: case ONE:
if (t1 == ARY)
tp1 = mktype(tp1->type, PTR, NULL, 0);
else if (t1 != PTR)
@@ -339,7 +340,7 @@
default: return np;
}
next();
- np = bincode(op, inttype, np, shift());
+ np = arithmetic(op, np, shift());
}
}