Allow far pointer to near pointer truncations to display as cast

This commit is contained in:
caheckman 2019-08-20 14:33:50 -04:00
parent 4edff2b9f0
commit 5944383088

View file

@ -269,8 +269,14 @@ bool CastStrategyC::isSubpieceCast(Datatype *outtype,Datatype *intype,uint4 offs
(outmeta!=TYPE_PTR)&& (outmeta!=TYPE_PTR)&&
(outmeta!=TYPE_FLOAT)) (outmeta!=TYPE_FLOAT))
return false; return false;
if ((inmeta==TYPE_PTR)&&((outmeta!=TYPE_INT) && (outmeta!=TYPE_UINT))) if (inmeta==TYPE_PTR) {
return false; //other casts don't make sense for pointers if (outmeta == TYPE_PTR) {
if (outtype->getSize() < intype->getSize())
return true; // Cast from far pointer to near pointer
}
if ((outmeta!=TYPE_INT) && (outmeta!=TYPE_UINT))
return false; //other casts don't make sense for pointers
}
return true; return true;
} }