Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge remote-tracking branch 'origin/patch'

Ryan Kurtz4ff113f92c7f
diff --cc Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
index 980c5ff135,af8e2bac3a..3397f986a8
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh
@@@ -516,7 -511,8 +516,8 @@@ public
JumpTable *linkJumpTable(PcodeOp *op); ///< Link jump-table with a given BRANCHIND
JumpTable *findJumpTable(const PcodeOp *op) const; ///< Find a jump-table associated with a given BRANCHIND
JumpTable *installJumpTable(const Address &addr); ///< Install a new jump-table for the given Address
+ JumpTable *recoverJumpTable(Funcdata &partial,PcodeOp *op,FlowInfo *flow,int4 &failuremode);
+ bool earlyJumpTableFail(PcodeOp *op); ///< Try to determine, early, if jump-table analysis will fail
- JumpTable *recoverJumpTable(PcodeOp *op,FlowInfo *flow,int4 &failuremode);
int4 numJumpTables(void) const { return jumpvec.size(); } ///< Get the number of jump-tables for \b this function
JumpTable *getJumpTable(int4 i) { return jumpvec[i]; } ///< Get the i-th jump-table
void removeJumpTable(JumpTable *jt); ///< Remove/delete the given jump-table
diff --cc Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
index 2ddda563fc,ac083b6381..98e0852517
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc
@@@ -576,8 -654,10 +653,10 @@@ JumpTable *Funcdata::recoverJumpTable(F
if ((flags & jumptablerecovery_dont)!=0)
return (JumpTable *)0; // Explicitly told not to recover jumptables
+ if (earlyJumpTableFail(op))
+ return (JumpTable *)0;
JumpTable trialjt(glb);
- failuremode = stageJumpTable(&trialjt,op,flow);
+ failuremode = stageJumpTable(partial,&trialjt,op,flow);
if (failuremode != 0)
return (JumpTable *)0;
// if (trialjt.is_twostage())