Skip to content
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

const vector triggers chained-const-assignment #13

Open
rtarquini opened this issue Aug 28, 2024 · 1 comment
Open

const vector triggers chained-const-assignment #13

rtarquini opened this issue Aug 28, 2024 · 1 comment

Comments

@rtarquini
Copy link

Is the intent to flag a vector of type const, or chained constants? the vector below will trip the rule.

const gr_fill_styles = ((/) = 9, () = 10, (|) = 7, (-) = 8, (+) = 11, (x) = 6)

I wouldn't think a vector would not trigger the rule, if that is intended, can you explain why that is an issue, or point me to a CVE.

Thanks.

@iuliadmtru
Copy link
Collaborator

Named tuples should indeed not trigger the rule. This is likely a bug in how Semgrep parses named tuples with parenthesised arguments. Regular named tuples are parsed fine, and the rule doesn't match those. I am expecting the last test case here to match after the bug gets fixed: https://semgrep.dev/playground/s/X5r1N

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

No branches or pull requests

2 participants