6c: return vlong result for pointer subtraction

This commit is contained in:
cinap_lenrek 2016-01-07 04:40:47 +01:00
parent 3e38194d72
commit 9c99d0c8d3

View file

@ -692,14 +692,6 @@ arith(Node *n, int f)
if(w < 1 || n->left->type->link == T || n->left->type->link->width < 1)
goto bad;
n->type = types[ewidth[TIND] <= ewidth[TLONG]? TLONG: TVLONG];
if(1 && ewidth[TIND] > ewidth[TLONG]){
n1 = new1(OXXX, Z, Z);
*n1 = *n;
n->op = OCAST;
n->left = n1;
n->right = Z;
n->type = types[TLONG];
}
if(w > 1) {
n1 = new1(OXXX, Z, Z);
*n1 = *n;
@ -715,6 +707,14 @@ arith(Node *n, int f)
n1->vconst = w;
}
}
if(0 && ewidth[TIND] > ewidth[TLONG]){
n1 = new1(OXXX, Z, Z);
*n1 = *n;
n->op = OCAST;
n->left = n1;
n->right = Z;
n->type = types[TLONG];
}
return;
}
if(!sametype(n->type, n->left->type)) {