GP-1297 More explicit support for typedefs in the decompiler (Closes #2393, Closes #3249)

This commit is contained in:
caheckman 2021-09-15 16:50:19 -04:00 committed by ghidra1
parent 8b2ea61e27
commit 8aed810d4a
10 changed files with 259 additions and 124 deletions

View file

@ -231,6 +231,10 @@ Datatype *CastStrategyC::castStandard(Datatype *reqtype,Datatype *curtype,
care_uint_int = true;
isptr = true;
}
while(reqbase->getTypedef() != (Datatype *)0)
reqbase = reqbase->getTypedef();
while(curbase->getTypedef() != (Datatype *)0)
curbase = curbase->getTypedef();
if (curbase == reqbase) return (Datatype *)0; // Different typedefs could point to the same type
if ((reqbase->getMetatype()==TYPE_VOID)||(curtype->getMetatype()==TYPE_VOID))
return (Datatype *)0; // Don't cast from or to VOID