Przeglądaj źródła

[LibOS] shim_parser.c: Additionally specify string as "const char*"

The parser logic checks the arguments of syscalls and prints strings in
debug output. Previously, our code base only contained "const char *" as
strings. Recently, we started migration to "const char*" (no-space) style.
This broke the parser logic, so this commit adds an additional check on
what it means for a C type to be a string.
Dmitrii Kuvaiskii 5 lat temu
rodzic
commit
07f0e25ff2
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      LibOS/shim/src/shim_parser.c

+ 2 - 2
LibOS/shim/src/shim_parser.c

@@ -441,7 +441,7 @@ static inline void parse_integer_arg(va_list ap) {
 static inline void parse_syscall_args(va_list ap) {
     const char* arg_type = va_arg(ap, const char*);
 
-    if (strcmp_static(arg_type, "const char *"))
+    if (strcmp_static(arg_type, "const char *") || strcmp_static(arg_type, "const char*"))
         parse_string_arg(ap);
     else if (is_pointer(arg_type))
         parse_pointer_arg(ap);
@@ -452,7 +452,7 @@ static inline void parse_syscall_args(va_list ap) {
 static inline void skip_syscall_args(va_list ap) {
     const char* arg_type = va_arg(ap, const char*);
 
-    if (strcmp_static(arg_type, "const char *"))
+    if (strcmp_static(arg_type, "const char *") || strcmp_static(arg_type, "const char*"))
         va_arg(ap, const char*);
     else if (is_pointer(arg_type))
         va_arg(ap, void*);