mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Opaque strings and variable length data-types
This commit is contained in:
parent
2c547ac41b
commit
547a4f2ab5
5 changed files with 211 additions and 76 deletions
|
@ -234,7 +234,12 @@ Datatype *CastStrategyC::castStandard(Datatype *reqtype,Datatype *curtype,
|
|||
if (curtype == reqtype) return (Datatype *)0; // Different typedefs could point to the same type
|
||||
if ((reqbase->getMetatype()==TYPE_VOID)||(reqbase->getMetatype()==TYPE_VOID))
|
||||
return (Datatype *)0; // Don't cast from or to VOID
|
||||
if (reqbase->getSize() != curbase->getSize()) return reqtype; // Always cast change in size
|
||||
if (reqbase->getSize() != curbase->getSize()) {
|
||||
if (reqbase->isVariableLength() && isptr && reqbase->hasSameVariableBase(curbase)) {
|
||||
return (Datatype *)0; // Don't need a cast
|
||||
}
|
||||
return reqtype; // Otherwise, always cast change in size
|
||||
}
|
||||
switch(reqbase->getMetatype()) {
|
||||
case TYPE_UNKNOWN:
|
||||
return (Datatype *)0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue