From 98439e2f9992d17e291f3cd475529d0f1704dd83 Mon Sep 17 00:00:00 2001 From: ghidra007 Date: Mon, 6 Jul 2026 21:21:04 +0000 Subject: [PATCH] GP-7042 rtti script better error handling of makeFunctionThisCall method to not derail the script. --- .../classrecovery/RecoveredClassHelper.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java index f10b89da60..80f25922cc 100644 --- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java +++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java @@ -2329,24 +2329,26 @@ public class RecoveredClassHelper { } /** - * Method to make the given function a thiscall + * Method to make the given function a thiscall unless doing so causes an exception in which + * case it will not be updated * @param function the given function - * @throws InvalidInputException if issues setting return type - * @throws DuplicateNameException if try to create same symbol name already in namespace */ - public void makeFunctionThiscall(Function function) - throws InvalidInputException, DuplicateNameException { + public void makeFunctionThiscall(Function function) { if (function.getCallingConventionName().equals(CompilerSpec.CALLING_CONVENTION_thiscall)) { return; } - ReturnParameterImpl returnType = - new ReturnParameterImpl(function.getSignature().getReturnType(), program); - - function.updateFunction(CompilerSpec.CALLING_CONVENTION_thiscall, returnType, - FunctionUpdateType.DYNAMIC_STORAGE_ALL_PARAMS, true, function.getSignatureSource(), - function.getParameters()); + ReturnParameterImpl returnType; + try { + returnType = new ReturnParameterImpl(function.getSignature().getReturnType(), program); + function.updateFunction(CompilerSpec.CALLING_CONVENTION_thiscall, returnType, + FunctionUpdateType.DYNAMIC_STORAGE_ALL_PARAMS, true, function.getSignatureSource(), + function.getParameters()); + } + catch (InvalidInputException | DuplicateNameException e) { + // don't update if there is an issue + } } /**