Skip to content

Explicit precedence clarifies logic in UseOfLegacyAlgorithm.ql#36

Merged
GrosQuildu merged 1 commit intomainfrom
legacy-alg-logic-clarification-patch
Feb 25, 2026
Merged

Explicit precedence clarifies logic in UseOfLegacyAlgorithm.ql#36
GrosQuildu merged 1 commit intomainfrom
legacy-alg-logic-clarification-patch

Conversation

@gsutherland-trailofbits
Copy link
Contributor

The logic in UseOfLegacyAlgorithm.ql current has bare and/or for the DES special-case, which is ambiguous if you don't know what CodeQL's conjunction/disjunction operator precedence is. The code is correct, but this PR adds parens to make it explicit and avoid confusion.

Not strictly a bugfix since CodeQL's precedence handles this already (disjunction occurs before conjunction) but the and/or logic for handling "DES" becomes clearer when wrapped in parens.
@GrosQuildu GrosQuildu merged commit 391bf34 into main Feb 25, 2026
1 of 2 checks passed
@GrosQuildu GrosQuildu deleted the legacy-alg-logic-clarification-patch branch February 25, 2026 09:57
@GrosQuildu
Copy link
Contributor

Oh man, I liked that addition but we are running autoformatting for codeql files and that removes the parentheses (in the other PR). Sorry, in the future we can try to configure the autoformatting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants