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/)
//
// identify a function that returns a negative return value at least once.
@ok exists@
identifier f,ret,i;
expression e;
constant c;
@@
f(...) {
... when any
(
return -c@i;
|
ret = -c@i;
... when !
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 ret
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 ret
4 matches
Mail list logo