C++: Fix small PrintAST and PrintIR issue#18277
Merged
Merged
Conversation
MathiasVP
reviewed
Dec 12, 2024
| key = "semmle.label" and | ||
| exists(string kinds | | ||
| kinds = | ||
| concat(EdgeKind k | |
Contributor
There was a problem hiding this comment.
If this is changed to a strictcount you could remove line 428, right?
Contributor
Author
There was a problem hiding this comment.
I still need 428 to correctly bind succBlock in the other side of the or, I think.
Contributor
There was a problem hiding this comment.
In the key = "semmle.order" case? That's bound by getSuccessorIndex anyway. Although, I do see that you need to rewrite the exists slightly to get rid of the resulting cartesian product with kind.
Contributor
Author
There was a problem hiding this comment.
In the
key = "semmle.order"case? That's bound bygetSuccessorIndexanyway.
Ah, you're right.
So are you thinking of something like:
query predicate edges(PrintableIRBlock pred, PrintableIRBlock succ, string key, string value) {
exists(IRBlock predBlock, IRBlock succBlock |
predBlock = pred.getBlock() and
succBlock = succ.getBlock() and
(
key = "semmle.label" and
exists(string kinds |
kinds =
strictconcat(EdgeKind k |
predBlock.getSuccessor(k) = succBlock
|
k.toString(), "|" order by k.toString()
)
|
if predBlock.getBackEdgeSuccessor(_) = succBlock
then value = kinds + " (back edge)"
else value = kinds
)
or
key = "semmle.order" and
value = getSuccessorIndex(predBlock, succBlock).toString()
)
)
}
MathiasVP
approved these changes
Dec 12, 2024
Contributor
MathiasVP
left a comment
There was a problem hiding this comment.
LGTM! The CI failures looks unrelated!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OverloadedArrayExpradd a test and fixPull Request checklist
All query authors
.qhelp. See the documentation in this repository.Internal query authors only
.ql,.qll, or.qhelpfiles. See the documentation (internal access required).