Check for null pointer when looking up endianess

This commit is contained in:
caheckman 2023-12-07 00:45:39 +00:00
parent 74528b49ec
commit 97acbb7208

View file

@ -1997,8 +1997,10 @@ void PrintC::pushPartialSymbol(const Symbol *sym,int4 off,int4 sz,
} }
else if (inslot >= 0) { else if (inslot >= 0) {
Datatype *outtype = vn->getHigh()->getType(); Datatype *outtype = vn->getHigh()->getType();
if (castStrategy->isSubpieceCastEndian(outtype,ct,off, AddrSpace *spc = sym->getFirstWholeMap()->getAddr().getSpace();
sym->getFirstWholeMap()->getAddr().getSpace()->isBigEndian())) { if (spc == (AddrSpace *)0)
spc = vn->getSpace();
if (castStrategy->isSubpieceCastEndian(outtype,ct,off,spc->isBigEndian())) {
// Treat truncation as SUBPIECE style cast // Treat truncation as SUBPIECE style cast
finalcast = outtype; finalcast = outtype;
ct = (Datatype*)0; ct = (Datatype*)0;