Skip to content

Commit

Permalink
GP-3454 Corrected regression in Decompiler Edit Function Signature
Browse files Browse the repository at this point in the history
  • Loading branch information
ghidra1 committed May 22, 2023
1 parent 0cae3ab commit 416a3e9
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import ghidra.program.model.symbol.SourceType;
import ghidra.util.HelpLocation;
import ghidra.util.UndefinedFunction;
import ghidra.util.exception.InvalidInputException;

public class SpecifyCPrototypeAction extends AbstractDecompilerAction {

Expand Down Expand Up @@ -117,6 +118,13 @@ private FunctionDefinitionDataType buildSignature(HighFunction hf) {
func.getName(), func.getProgram().getDataTypeManager());
FunctionPrototype functionPrototype = hf.getFunctionPrototype();

try {
fsig.setCallingConvention(functionPrototype.getModelName());
}
catch (InvalidInputException e) {
// ignore
}

int np = hf.getLocalSymbolMap().getNumParams();
fsig.setReturnType(functionPrototype.getReturnType());

Expand Down Expand Up @@ -172,7 +180,6 @@ protected void decompilerActionPerformed(DecompilerActionContext context) {
if (function.getEntryPoint().equals(hf.getFunction().getEntryPoint())) {
if (function.getSignatureSource() == SourceType.DEFAULT) {
model.setUseCustomizeStorage(false);
model.setCallingConventionName(functionPrototype.getModelName());
model.setFunctionData(buildSignature(hf));
verifyDynamicEditorModel(hf, model);
}
Expand Down

0 comments on commit 416a3e9

Please sign in to comment.