Merge pull request #1927 from jbj/instructionNode

C++: Add DataFlow::instructionNode
This commit is contained in:
Robert Marsh
2019-09-12 12:06:01 -07:00
committed by GitHub
2 changed files with 6 additions and 4 deletions

View File

@@ -22,10 +22,7 @@ private predicate predictable(Expr expr) {
// TODO: remove when `predictable` has an `Instruction` parameter instead of `Expr`.
private predicate predictableInstruction(Instruction instr) {
exists(DataFlow::Node node |
node.asInstruction() = instr and
predictable(node.asExpr())
)
predictable(DataFlow::instructionNode(instr).asExpr())
}
private class DefaultTaintTrackingCfg extends DataFlow::Configuration {

View File

@@ -156,6 +156,11 @@ abstract class PostUpdateNode extends Node {
abstract Node getPreUpdateNode();
}
/**
* Gets the node corresponding to `instr`.
*/
Node instructionNode(Instruction instr) { result.asInstruction() = instr }
/**
* Gets a `Node` corresponding to `e` or any of its conversions. There is no
* result if `e` is a `Conversion`.