Ghidra is a software reverse engineering (SRE) framework
Handle TYPE_CODE in isPtrsubMatching
caheckman86f4daefc594
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.ccindex e9d98b3774..4720263081 100644--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc@@ -1329,11 +1329,15 @@ bool TypePointer::isPtrsubMatching(int8 off,int8 extra,int8 multiplier) constreturn false;}}- else if (ptrto->getMetatype() == TYPE_UNION) {+ else if (meta == TYPE_UNION) {// A PTRSUB reaching here cannot be used for a union field resolution// These are created by ActionSetCasts::resolveUnionreturn false; // So we always return false}+ else if (meta == TYPE_CODE) {+ if (extra < 0)+ return false;+ }elsereturn false; // Not a pointer to a structured data-typereturn true;