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

metavariable-pattern with pattern-regex doesn't match _ #10193

Open
1 of 3 tasks
sim642 opened this issue May 2, 2024 · 0 comments
Open
1 of 3 tasks

metavariable-pattern with pattern-regex doesn't match _ #10193

sim642 opened this issue May 2, 2024 · 0 comments

Comments

@sim642
Copy link

sim642 commented May 2, 2024

Describe the bug
metavariable-pattern with pattern-regex doesn't match _, while metavariable-regex with the same regex does.
The former also produces:

Internal matching error when running try-catch-all-bug on target.ml:
 An error occurred while invoking the Semgrep engine. Please help us fix this by creating an issue at https://github.com/returntocorp/semgrep

metavariable-pattern failed because $E does not bind to a sub-program, please check your rule Engine(MatchingError)

To Reproduce
Doesn't work: https://semgrep.dev/playground/s/L1qv9.
Works: https://semgrep.dev/playground/s/8GNPq.

Expected behavior
_ is matched in both cases, regardless of metavariable matching syntax.

What is the priority of the bug to you?

  • P0: blocking your adoption of Semgrep or workflow
  • P1: important to fix or quite annoying
  • P2: regular bug that should get fixed

Use case
Write rule for catch-all exception handlers, regardless of whether they use a wildcard or an identifier.

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

No branches or pull requests

1 participant