[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] trace: Fix 'char **' compilation error in simple ba
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH] trace: Fix 'char **' compilation error in simple backend |
Date: |
Wed, 26 Oct 2016 09:59:32 +0800 |
Currently, the generated function body will do "strlen(arg)" but the
argument could be 'char **'. Avoid that by exclusding such cases in
is_string check.
Reported by patchew's "make address@hidden".
Signed-off-by: Fam Zheng <address@hidden>
---
scripts/tracetool/backend/simple.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/tracetool/backend/simple.py
b/scripts/tracetool/backend/simple.py
index 9885e83..2538795 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -21,7 +21,9 @@ PUBLIC = True
def is_string(arg):
strtype = ('const char*', 'char*', 'const char *', 'char *')
- if arg.lstrip().startswith(strtype):
+ non_strtype = ('const char**', 'char**', 'const char **', 'char **')
+ arg_strip = arg.lstrip()
+ if arg_strip.startswith(strtype) and not arg_strip.startswith(non_strtype):
return True
else:
return False
--
2.7.4
- [Qemu-devel] [PATCH] trace: Fix 'char **' compilation error in simple backend,
Fam Zheng <=