mirror of
https://github.com/github/codeql.git
synced 2026-03-29 03:38:17 +02:00
24 lines
672 B
Plaintext
24 lines
672 B
Plaintext
/**
|
|
* Provides a predicate for non-contextual virtual dispatch and function
|
|
* pointer resolution.
|
|
*/
|
|
|
|
import cpp
|
|
private import semmle.code.cpp.ir.ValueNumbering
|
|
private import internal.DataFlowDispatch
|
|
private import semmle.code.cpp.ir.IR
|
|
|
|
/**
|
|
* Resolve potential target function(s) for `call`.
|
|
*
|
|
* If `call` is a call through a function pointer (`ExprCall`) or its target is
|
|
* a virtual member function, simple data flow analysis is performed in order
|
|
* to identify the possible target(s).
|
|
*/
|
|
Function resolveCall(Call call) {
|
|
exists(CallInstruction callInstruction |
|
|
callInstruction.getAst() = call and
|
|
result = viableCallable(callInstruction)
|
|
)
|
|
}
|