diff options
| author | Zichuan Li <34680029+river-li@users.noreply.github.com> | 2024-05-31 11:19:55 -0400 |
|---|---|---|
| committer | Zichuan Li <34680029+river-li@users.noreply.github.com> | 2024-05-31 15:27:38 -0400 |
| commit | 4279136cc033e93a2ec4afec0c6cab037e76c907 (patch) | |
| tree | 8c3e121a019db403f28453989bff68ddd4bcba10 /arch/mips/arch_mips.cpp | |
| parent | 12d47835b1127605d224178e8e67c29f609a1a86 (diff) | |
Fixed type propagation issue in AARCH64 and MIPS
Previously, prtinf type library is not being appropriately applied.
#3092
Diffstat (limited to 'arch/mips/arch_mips.cpp')
| -rw-r--r-- | arch/mips/arch_mips.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/arch/mips/arch_mips.cpp b/arch/mips/arch_mips.cpp index 50ad0f75..1fa6b169 100644 --- a/arch/mips/arch_mips.cpp +++ b/arch/mips/arch_mips.cpp @@ -1747,8 +1747,20 @@ private: Ref<Symbol> funcSym = Symbol::ImportedFunctionFromImportAddressSymbol(sym, func->GetStart()); data->DefineAutoSymbol(funcSym); - func->ApplyImportedTypes(funcSym); - return true; + for (auto& extSym : data->GetSymbolsByName(funcSym->GetRawName())) + { + if (extSym->GetType() == ExternalSymbol) + { + DataVariable var; + if (data->GetDataVariableAtAddress(extSym->GetAddress(), var)) + { + func->ApplyImportedTypes(funcSym, var.type); + } + + return true; + } + } + return false; } @@ -1939,7 +1951,19 @@ private: Ref<Symbol> funcSym = Symbol::ImportedFunctionFromImportAddressSymbol(sym, func->GetStart()); data->DefineAutoSymbol(funcSym); - func->ApplyImportedTypes(funcSym); + for (auto& extSym : data->GetSymbolsByName(funcSym->GetRawName())) + { + if (extSym->GetType() == ExternalSymbol) + { + DataVariable var; + if (data->GetDataVariableAtAddress(extSym->GetAddress(), var)) + { + func->ApplyImportedTypes(funcSym, var.type); + } + + return true; + } + } return true; } |
