Hi,
I cannot understand why it happens:
@@
expression x;
expression E;
identifier free ~= "^kfree$\|^kput$\|^put_device$\|^input_unregister_device$";
@@
*free(x);
... when != x
(
x = E
|
* x
)
--- main.c 2010-11-13 14:16:31.000000000 +0300
+++ /tmp/cocci-output-18580-98aa90-main.c 2010-11-13
14:18:27.000000000 +0300
@@ -16,8 +16,6 @@ main(int argc, char **argv)
void *x;
void *y;
- for (x = &y; x == &y; x = &y)
- kfree(x);
return 0;
--
The real sequence here is:
kfree(x);
x = &y;
x == &y;
I thought it is a bug in for(;;) handling, but no:
@@
@@
*a
...
*b
--- main.c 2010-11-13 14:21:35.000000000 +0300
+++ /tmp/cocci-output-18655-497441-main.c 2010-11-13
14:21:43.000000000 +0300
@@ -19,8 +19,6 @@ main(int argc, char **argv)
for (;;x = &y)
kfree(x);
- for( ; ; b)
- a;
return 0;
--
It is caught.
Am I missing smth in "..." handling?
Thanks,
--
Vasiliy
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)