The complate semantic patch that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
//
@ok exists@
identifier f,ret,i;
expression e;
constant c;
@@
// identify a function that returns a negative return value at least once.
f(...) {
... when any
(
return -c@i;
|
ret = -c@i;
... when
The complate semantic patch that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@ok exists@
identifier f,ret,i;
expression e;
constant c;
@@
// identify a function that returns a negative return value at least once.
f(...) {
... when any
(
return -c@i;
|
ret = -c@i;
...
These patches fix cases where the return code appears to be unintentially 0.
The complete semantic match that finds the problem is as follows:
(http://coccinelle.lip6.fr/)
//
@r@
identifier f;
expression ret,e;
constant C;
@@
f(...) { <+...
(
return -C;
|
ret = -C
... when != ret = e
return
These patches fix cases where the return code appears to be unintentially 0.
The complete semantic match that finds the problem is as follows:
(http://coccinelle.lip6.fr/)
// smpl
@r@
identifier f;
expression ret,e;
constant C;
@@
f(...) { +...
(
return -C;
|
ret = -C
... when != ret = e
return
4 matches
Mail list logo