You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, variables ($foo) don't match on number literals so this is expected behavior.
I've been thinking about changing that, but I'm worried that this makes certain queries to noisy.
For example, memcpy(_,_,$x) currently only matches on identifiers in the size field, but not literals and often that's exactly what I want.
I'm currently thinking about the following change:
Extend the behavior of numeric variables $0 $1 $1337 to match on identifiers AND number literals. "Normal" variables would still behave as they currently do. This gives an easy way to opt-in to number matching, but adds additional magic to the query language.
Sorry for the late reply, yes that would absolutely work for me! I think we're willing to learn a bit of weggli-specific query language magic in order to find magic bugs :)
Hey, thanks for weggli, it's so awesome ;)
I ran into an issue and wanted to see if you had a solution for it:
Given this pattern:
weggli -u '{char $buf[$len];snprintf($buf, $len2,_);}' test.c
I expect the following lines to be matched:
By minimalizing the pattern, I found that a pattern like
$buf[$a]
won't matchchar buffer[80];
but$buf[_]
will. Am I doing something wrong?The text was updated successfully, but these errors were encountered: