ref: a0697ff99ca952c46320707b2532bf1459078f56
parent: 7d2dc676c5bf542cdedee28ec75278bd3b5871af
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jan 24 17:45:48 EST 2016
A pointer isn't an unsigned int...
--- a/6/simp.c
+++ b/6/simp.c
@@ -1256,6 +1256,7 @@
[Ole] = {Ole, Oule, Ofle}
};
Node *r;
+ Type *ty;
Op newop;
/* void is always void */
@@ -1263,11 +1264,16 @@
return mkboollit(n->loc, 1);
newop = Obad;
- if (istysigned(tybase(exprtype(n->expr.args[0]))))
+ ty = tybase(exprtype(n->expr.args[0]));
+ if (istysigned(ty))
newop = cmpmap[n->expr.op][0];
- else if (istyunsigned(tybase(exprtype(n->expr.args[0]))))
+ else if (istyunsigned(ty))
newop = cmpmap[n->expr.op][1];
- else if (istyfloat(tybase(exprtype(n->expr.args[0]))))
+ else if (istyunsigned(ty))
+ newop = cmpmap[n->expr.op][1];
+ else if (ty->type == Typtr)
+ newop = cmpmap[n->expr.op][1];
+ else if (istyfloat(ty))
newop = cmpmap[n->expr.op][2];
if (newop != Obad) {
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1325,7 +1325,11 @@
settype(st, n, t);
n->expr.did = s->decl.did;
break;
- case Ogap: infernode(st, np, NULL, NULL); break;
+ case Oaddr:
+ infernode(st, np, NULL, NULL);
+ break;
+ case Ogap:
+ infernode(st, np, NULL, NULL); break;
default: fatal(n, "invalid pattern"); break;
}
}
--- a/parse/type.c
+++ b/parse/type.c
@@ -314,7 +314,6 @@
case Tychar:
case Tyuint32:
case Tyuint64:
- case Typtr:
case Tybool: return 1;
default: return 0;
}