mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Move 'snippet' queries to 'snippets' folders
This commit is contained in:
16
cpp/ql/examples/snippets/mutualrecursion.ql
Normal file
16
cpp/ql/examples/snippets/mutualrecursion.ql
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @name Mutual recursion
|
||||
* @description Finds pairs of functions that call each other
|
||||
* @tags function
|
||||
* method
|
||||
* recursion
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
from Function m, Function n
|
||||
where
|
||||
exists(FunctionCall c | c.getEnclosingFunction() = m and c.getTarget() = n) and
|
||||
exists(FunctionCall c | c.getEnclosingFunction() = n and c.getTarget() = m) and
|
||||
m != n
|
||||
select m, n
|
||||
Reference in New Issue
Block a user