-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need help in implementing a predicate in a query #17153
Comments
from ParameterOrResultDecl d
select d.getEnclosingFunction() The implementation can be found in AST.qll -- try ctrl/cmd-clicking in VS Code to navigate to the definition. /** Gets the innermost function definition to which this AST node belongs, if any. */
FuncDef getEnclosingFunction() { result = this.getParent().parentInSameFunction*() }
|
@smowton I think I was not able to explain my problem, What I want to do is
I want to make sure that |
We don't have |
This issue is stale because it has been open 14 days with no activity. Comment or remove the |
This issue was closed because it has been inactive for 7 days. |
Description of the issue
I want to write a predicate similar to getEnclosingFunction() for
TypeDecl
s andParameterOrResultDecl
s.The problem I am facing is i want to limit my search of certain entities to a particular TypeDecl but there is no convenient predicate like getEnclosingTypeDecl() that I can use.
Please
1.share the implementation of
getEnclosingFunction()
predicate2. help me write some similar predicate for any type in codeql(but particularly
TypeDecl
andParameterOrResultDecl
).The text was updated successfully, but these errors were encountered: