Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Checking exception handling implementations with SmPL
@ 2017-05-14 15:41 SF Markus Elfring
  2017-05-18 13:00 ` [Cocci] Checking source code (including optional parts) " SF Markus Elfring
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: SF Markus Elfring @ 2017-05-14 15:41 UTC (permalink / raw)
  To: cocci

Hello,

I would like to check the implementation of exception handling in various
source files. The following script for the semantic patch language tries to
express a few possibilities for such a source code search pattern.


@show_special_reactions@
expression error_code, var;
identifier action =~ "^(?:malloc|strdup)$",
           no_return =~ "[Aa]bort",
           label;
statement es;
@@
 var = action(...);
 if (failed(var))
 {
(
*   return error_code;
|
*   goto label;
|
*   no_return();
)
 }
 else
 es


I find this approach too simple and therefore incomplete. Three well-known
reactions are shown. But there can be more source code before these statements
like further function calls and variable assignments.
We do eventually not know the extra code there and it can also be
generally optional.

How can the Coccinelle software help any more in such an use case?

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-05-23 10:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-14 15:41 [Cocci] Checking exception handling implementations with SmPL SF Markus Elfring
2017-05-18 13:00 ` [Cocci] Checking source code (including optional parts) " SF Markus Elfring
2017-05-18 15:21 ` [Cocci] Safe determination of function properties for SmPL scripts SF Markus Elfring
2017-05-18 16:00 ` [Cocci] Checking failure predicates with SmPL SF Markus Elfring
2017-05-23  9:01 ` [Cocci] Easier search for assignment targets " SF Markus Elfring
2017-05-23  9:06   ` Julia Lawall
2017-05-23 10:52     ` SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox