Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-4102 Fix infinite loop thru RulePiecePathology

caheckman5a7ad72476c0
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
index 29ccc11120..839223ea14 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
@@ -5629,9 +5629,11 @@ bool FuncCallSpecs::setInputBytesConsumed(int4 slot,int4 val) const
while(inputConsume.size() <= slot)
inputConsume.push_back(0);
int4 oldVal = inputConsume[slot];
- if (oldVal == 0 || val < oldVal)
+ if (oldVal == 0 || val < oldVal) { // Only let the value get smaller
inputConsume[slot] = val;
- return (oldVal != val);
+ return true;
+ }
+ return false;
}
/// \brief Prepend any extra parameters if a paramshift is required