mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
C++: Add FlowSummaryNode and test it.
This commit is contained in:
@@ -57,7 +57,8 @@ private newtype TIRDataFlowNode =
|
||||
hasFinalParameterNode(_, p, indirectionIndex)
|
||||
} or
|
||||
TFinalGlobalValue(Ssa::GlobalUse globalUse) or
|
||||
TInitialGlobalValue(Ssa::GlobalDef globalUse)
|
||||
TInitialGlobalValue(Ssa::GlobalDef globalUse) or
|
||||
TFlowSummaryNode(FlowSummaryImpl::Private::SummaryNode sn)
|
||||
|
||||
/**
|
||||
* Holds if `(p, indirectionIndex)` should define a `TFinalParameterNode`
|
||||
@@ -760,6 +761,31 @@ class InitialGlobalValue extends Node, TInitialGlobalValue {
|
||||
override string toStringImpl() { result = globalDef.toString() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A data-flow node used to model flow summaries.
|
||||
*/
|
||||
class FlowSummaryNode extends Node, TFlowSummaryNode {
|
||||
FlowSummaryImpl::Private::SummaryNode getSummaryNode() { this = TFlowSummaryNode(result) }
|
||||
|
||||
/**
|
||||
* TODO: QLDoc.
|
||||
*/
|
||||
FlowSummaryImpl::Public::SummarizedCallable getSummarizedCallable() {
|
||||
result = this.getSummaryNode().getSummarizedCallable()
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: QLDoc.
|
||||
*/
|
||||
override DataFlowCallable getEnclosingCallable() {
|
||||
none() //result.asSummarizedCallable() = this.getSummarizedCallable() TODO
|
||||
}
|
||||
|
||||
override Location getLocationImpl() { result = this.getSummarizedCallable().getLocation() }
|
||||
|
||||
override string toStringImpl() { result = this.getSummaryNode().toString() }
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: do not use.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user