Commit 638dca4f authored by Lukas Rytz's avatar Lukas Rytz Committed by Jason Zaugg

Allow setting stack values in analysis frames

Adds a method `setStack` to analysis.Frame which allows setting the
dataflow value of a stack slot.

Could be used in nullness analysis. After, for example, an instance call,
aliases of the receiver can be set to NotNull, both in locals and on the
stack.
parent c4a9e49c
......@@ -178,6 +178,17 @@ public class Frame<V extends Value> {
return values[nLocals + index];
}
/**
* Sets the value of the given stack slot.
*
* @param index the index of an operand stack slot.
* @param value the new value of the stack slot.
* @throws IndexOutOfBoundsException if the stack slot does not exist.
*/
public void setStack(final int index, final V value) throws IndexOutOfBoundsException {
values[index + nLocals] = value;
}
/** Clears the operand stack of this frame. */
public void clearStack() {
nStack = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment