Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

What's the true term in codeql? #15450

Unanswered
Gao-Chuan asked this question in Q&A
Jan 27, 2024 · 2 comments · 2 replies
Discussion options

I wanna do this:

 from Call c, Expr guard
 where
 exists(Expr e| 
 guard = callCheck(e, 0) and
 DataFlow::localFlow(DataFlow::exprNode(c), DataFlow::exprNode(e))
 ) and true
 select guard.getLocation(), guard.toString()

I've searched the document but can't find a term means logic true.

Current code has such error, and I totally understand why I have this error:

ERROR: Expected a term but found an expression instead 

I want to know how to do a search like XXX and true

You must be logged in to vote

Replies: 2 comments 2 replies

Comment options

I need the true because I'm trying to automatically generate queries.

You must be logged in to vote
1 reply
Comment options

Try any().

Comment options

Try any().

Well currently I'm using an ugly 1=1.

You must be logged in to vote
1 reply
Comment options

1=1 works indeed, but best use any() as @intrigus-lgtm suggested. The opposite of any() is none() in case you need to generate a sequence of or terms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /