mirror of
https://github.com/github/codeql.git
synced 2025-12-23 12:16:33 +01:00
C++: Ensure that only one Function exists for every function
This commit is contained in:
@@ -110,8 +110,8 @@ private predicate loopConditionAlwaysUponEntry(ControlFlowNode loop, Expr condit
|
||||
* should be in this relation.
|
||||
*/
|
||||
pragma[noinline]
|
||||
private predicate isFunction(Element el) {
|
||||
el instanceof Function
|
||||
private predicate isFunction(@element el) {
|
||||
el instanceof @function
|
||||
or
|
||||
el.(Expr).getParent() = el
|
||||
}
|
||||
@@ -122,7 +122,7 @@ private predicate isFunction(Element el) {
|
||||
*/
|
||||
pragma[noopt]
|
||||
private predicate callHasNoTarget(@funbindexpr fc) {
|
||||
exists(Function f |
|
||||
exists(@function f |
|
||||
funbind(fc, f) and
|
||||
not isFunction(f)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user