weggli-rs / weggli

weggli is a fast and robust semantic search tool for C and C++ codebases. It is designed to help security researchers identify interesting functionality in large codebases.
Apache License 2.0
2.32k stars 127 forks source link

How to define two statements within a block? #80

Open wcy1997 opened 1 year ago

wcy1997 commented 1 year ago

I want to search for vulnerability code for unique_ptr moved twice. Therefore, I need to search for code snippets in the same block for double move statements. For example, { std::move(a); std::move(a) } How can I search such code snippets?

p.s. I find that tree-sitter supports such feature. image

wcy1997 commented 1 year ago

tree-sitter doc: https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax