qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2] trace: Fix 'char **' compilation error in simple


From: Fam Zheng
Subject: [Qemu-devel] [PATCH v2] trace: Fix 'char **' compilation error in simple backend
Date: Wed, 26 Oct 2016 11:50:06 +0800

Currently, the generated function body will do "strlen(arg)" but the
argument could be 'char **' or 'char * const *'. Avoid that by excluding
such cases in is_string check.

Reported by patchew's "make address@hidden".

Suggested-by: Eric Blake <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>

---

v2: Fix typo in commit message and "yeah we'll be counting stars".  [Eric]
---
 scripts/tracetool/backend/simple.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/tracetool/backend/simple.py 
b/scripts/tracetool/backend/simple.py
index 9885e83..85f6102 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -21,7 +21,8 @@ PUBLIC = True
 
 def is_string(arg):
     strtype = ('const char*', 'char*', 'const char *', 'char *')
-    if arg.lstrip().startswith(strtype):
+    arg_strip = arg.lstrip()
+    if arg_strip.startswith(strtype) and arg_strip.count('*') == 1:
         return True
     else:
         return False
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]