GP-3067: Changes in anticipation of GP-2038.

This commit is contained in:
Dan 2023-01-30 14:59:49 -05:00
parent 9014d10edf
commit b8e1808cb8
7 changed files with 44 additions and 36 deletions

View file

@ -187,12 +187,12 @@ public abstract class AbstractVarnodeEvaluator<T> implements VarnodeEvaluator<T>
/**
* Evaluate variable storage, providing an "identity" value
*
* @param program the program containing the variable storage
* @param storage the storage to evaluate
* @param identity the value if storage had no varnodes
* @return the value of the storage
*/
protected T evaluateStorage(VariableStorage storage, T identity) {
Program program = storage.getProgram();
protected T evaluateStorage(Program program, VariableStorage storage, T identity) {
int total = storage.size();
T value = identity;
for (Varnode vn : storage.getVarnodes()) {

View file

@ -17,7 +17,7 @@ package ghidra.pcode.eval;
import java.util.Map;
import ghidra.pcode.exec.*;
import ghidra.pcode.exec.PcodeArithmetic;
import ghidra.pcode.exec.PcodeArithmetic.Purpose;
import ghidra.pcode.opbehavior.BinaryOpBehavior;
import ghidra.pcode.opbehavior.UnaryOpBehavior;
@ -75,8 +75,8 @@ public abstract class ArithmeticVarnodeEvaluator<T> extends AbstractVarnodeEvalu
}
@Override
public T evaluateStorage(VariableStorage storage) {
return evaluateStorage(storage, arithmetic.fromConst(0, storage.size()));
public T evaluateStorage(Program program, VariableStorage storage) {
return evaluateStorage(program, storage, arithmetic.fromConst(0, storage.size()));
}
@Override

View file

@ -50,10 +50,11 @@ public interface VarnodeEvaluator<T> {
* concatenated. The lower-indexed varnodes in storage are the more significant pieces, similar
* to big endian.
*
* @param program the program containing the variable storage
* @param storage the storage
* @return the value of the storage
*/
T evaluateStorage(VariableStorage storage);
T evaluateStorage(Program program, VariableStorage storage);
/**
* Evaluate a high p-code op