mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
JS: Add some missing getContainer() predicates
This commit is contained in:
@@ -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() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user