mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-29 03:55:53 +08:00
GP-0: Fix VarargsFilter doing nothing due to firstVarArgSlot never being set
When the Function Editor assigns parameter storage, PrototypePieces.firstVarArgSlot was always left at -1, causing VarargsFilter.filter() to unconditionally return false. Any .cspec rule using <varargs/> (e.g. MSP430's goto_stack for the last fixed arg) had no effect when storage was (re-)assigned via the UI. Fix: add a getStorageLocations overload that accepts an isVarArgs flag. When true, firstVarArgSlot is set to proto.intypes.size() — meaning all supplied parameters are non-optional and the first vararg slot follows immediately after the last one. FunctionData.updateParameterAndReturnStorage() now passes hasVarArgs to this overload, so VarargsFilter-based rules fire correctly. Fixes #9091 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -218,7 +218,7 @@ class FunctionData extends FunctionDataView {
|
||||
}
|
||||
|
||||
VariableStorage[] paramStorage =
|
||||
effectiveCallingConvention.getStorageLocations(getProgram(), dataTypes, true);
|
||||
effectiveCallingConvention.getStorageLocations(getProgram(), dataTypes, true, hasVarArgs);
|
||||
|
||||
returnInfo.setStorage(paramStorage[0]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user