Skip to content

Instantly share code, notes, and snippets.

@kaworu
Created June 11, 2017 08:09
Show Gist options
  • Save kaworu/14910868052bb248e55ea73802f45d5b to your computer and use it in GitHub Desktop.
Save kaworu/14910868052bb248e55ea73802f45d5b to your computer and use it in GitHub Desktop.
@r1@
type T;
position p;
identifier i;
constant c1, c2, c3;
@@
T i@p[
(
c1
|
c2 + c3
)
];
@r2@
type T;
position p != r1.p;
identifier i;
expression e;
@@
T i@p[e];
@script:python r3@
p << r2.p;
@@
cocci.print_main("",p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment