mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-07-30 07:18:37 -09:00
Merge remote-tracking branch
'origin/GP-7042_ghidra007_rtti_script_better_eror_handling_make_thiscalls' (Closes #8168)
This commit is contained in:
@@ -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
|
* @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)
|
public void makeFunctionThiscall(Function function) {
|
||||||
throws InvalidInputException, DuplicateNameException {
|
|
||||||
|
|
||||||
if (function.getCallingConventionName().equals(CompilerSpec.CALLING_CONVENTION_thiscall)) {
|
if (function.getCallingConventionName().equals(CompilerSpec.CALLING_CONVENTION_thiscall)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnParameterImpl returnType =
|
ReturnParameterImpl returnType;
|
||||||
new ReturnParameterImpl(function.getSignature().getReturnType(), program);
|
try {
|
||||||
|
returnType = new ReturnParameterImpl(function.getSignature().getReturnType(), program);
|
||||||
function.updateFunction(CompilerSpec.CALLING_CONVENTION_thiscall, returnType,
|
function.updateFunction(CompilerSpec.CALLING_CONVENTION_thiscall, returnType,
|
||||||
FunctionUpdateType.DYNAMIC_STORAGE_ALL_PARAMS, true, function.getSignatureSource(),
|
FunctionUpdateType.DYNAMIC_STORAGE_ALL_PARAMS, true, function.getSignatureSource(),
|
||||||
function.getParameters());
|
function.getParameters());
|
||||||
|
}
|
||||||
|
catch (InvalidInputException | DuplicateNameException e) {
|
||||||
|
// don't update if there is an issue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user