JS: Add some missing getContainer() predicates

This commit is contained in:
Asger F
2023-10-03 09:52:09 +02:00
parent 21300eef4c
commit 01952f17bf

View File

@@ -765,6 +765,8 @@ module DataFlow {
override Node getRhs() { result = TValueNode(prop.getParameter()) }
override ControlFlowNode getWriteNode() { result = prop.getParameter() }
override StmtContainer getContainer() { parameter_fields(prop, result, _) }
}
/**
@@ -962,6 +964,12 @@ module DataFlow {
override BasicBlock getBasicBlock() { result = function.getExit().getBasicBlock() }
override StmtContainer getContainer() {
// Override this to ensure a container exists even for unreachable returns,
// since an unreachable exit CFG node will not have a basic block
result = function
}
/**
* Gets the function corresponding to this exceptional return node.
*/
@@ -988,6 +996,12 @@ module DataFlow {
override BasicBlock getBasicBlock() { result = function.getExit().getBasicBlock() }
override StmtContainer getContainer() {
// Override this to ensure a container exists even for unreachable returns,
// since an unreachable exit CFG node will not have a basic block
result = function
}
/**
* Gets the function corresponding to this return node.
*/
@@ -1386,6 +1400,8 @@ module DataFlow {
}
override string toString() { result = this.getTag().toString() }
override StmtContainer getContainer() { result = this.getTag().getInnerTopLevel() }
}
/**