Package com.tonic.analysis.dataflow
Class DataFlowNode
- java.lang.Object
-
- com.tonic.analysis.dataflow.DataFlowNode
-
public class DataFlowNode extends Object
A node in the data flow graph standing for a value or operation, with mutable taint state.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataFlowNode.BuilderMutable accumulator for the immutable fields of aDataFlowNode.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataFlowNode.Builderbuilder()booleanequals(Object o)intgetBlockId()StringgetDescription()intgetId()IRInstructiongetInstruction()intgetInstructionIndex()StringgetLabel()StringgetLocation()StringgetName()SSAValuegetSsaValue()StringgetTaintSource()StringgetTooltip()Builds multi-line hover text with the type, location, SSA type and taint state.DataFlowNodeTypegetType()inthashCode()booleanisTainted()voidsetTainted(boolean tainted)Sets the taint flag without touching the recorded source.voidsetTaintSource(String source)Records where the taint came from, setting the tainted flag to match.StringtoString()
-
-
-
Method Detail
-
getId
public int getId()
- Returns:
- the id
-
getType
public DataFlowNodeType getType()
- Returns:
- the type
-
getName
public String getName()
- Returns:
- the name
-
getDescription
public String getDescription()
- Returns:
- the description
-
getSsaValue
public SSAValue getSsaValue()
- Returns:
- the ssa value
-
getInstruction
public IRInstruction getInstruction()
- Returns:
- the instruction
-
getBlockId
public int getBlockId()
- Returns:
- the block id
-
getInstructionIndex
public int getInstructionIndex()
- Returns:
- the instruction index
-
isTainted
public boolean isTainted()
- Returns:
- whether tainted
-
getTaintSource
public String getTaintSource()
- Returns:
- the taint source
-
setTainted
public void setTainted(boolean tainted)
Sets the taint flag without touching the recorded source.- Parameters:
tainted- new taint state
-
setTaintSource
public void setTaintSource(String source)
Records where the taint came from, setting the tainted flag to match.- Parameters:
source- origin description, or null to clear the taint
-
getLabel
public String getLabel()
- Returns:
- the name, else the SSA value's name, else the type display name with the id appended
-
getLocation
public String getLocation()
- Returns:
- the position formatted as "blockN:index"
-
getTooltip
public String getTooltip()
Builds multi-line hover text with the type, location, SSA type and taint state.- Returns:
- the tooltip text
-
builder
public static DataFlowNode.Builder builder()
- Returns:
- a new builder with type defaulted to LOCAL
-
-