diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2019-04-28 17:13:29 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2019-04-29 15:38:53 +0200 |
commit | 60d9959dd8ba90e4a112e6e65429b112334d1bf8 (patch) | |
tree | bb83c9c370cb9660ccb327b32ef4468fe847af80 /coccinelle/const-strlen.cocci | |
parent | 33af88cf70fce38a39642e92609cfba655925d55 (diff) | |
download | systemd-60d9959dd8ba90e4a112e6e65429b112334d1bf8.tar.gz |
coccinelle: ignore function transformations causing recursion
For example, following transformation:
- isempty(s) ? NULL : s
+ empty_to_null(s)
would get applied to the empty_to_null function itself as well,
causing an infinite recursion, like:
--- src/basic/string-util.h
+++ /tmp/cocci-output-307-9f76e6-string-util.h
@@ -50,11 +50,11 @@ static inline bool isempty(const char *p
}
static inline const char *empty_to_null(const char *p) {
- return isempty(p) ? NULL : p;
+ return empty_to_null(p);
}
Let's avoid that by checking the current match position
Diffstat (limited to 'coccinelle/const-strlen.cocci')
0 files changed, 0 insertions, 0 deletions