semgrep / semgrep

Lightweight static analysis for many languages. Find bug variants with patterns that look like source code.
https://semgrep.dev
GNU Lesser General Public License v2.1
10.4k stars 602 forks source link

semgrep metavariable pattern seems match wrong code #5904

Closed zhengow closed 2 years ago

zhengow commented 2 years ago

Describe the bug metavariable pattern seems match wrong code

To Reproduce https://semgrep.dev/s/Dx1y

Expected behavior I think it should only match print(1), however it also matches another line.

Screenshots If applicable, add screenshots to help explain your problem. image

What is the priority of the bug to you?

Environment If not using semgrep.dev: are you running off docker, an official binary, a local build?

Use case What will fixing this bug enable for you?

r2c-demo commented 2 years ago

This issue is synced in Linear at https://linear.app/r2c/issue/PA-1756/semgrep-metavariable-pattern-seems-match-wrong-code. Note: this link is for r2c use only and is not accessible publicly.