]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
arc: use is_whitespace()
authorJan Beulich <jbeulich@suse.com>
Mon, 3 Feb 2025 10:50:03 +0000 (11:50 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 3 Feb 2025 10:50:03 +0000 (11:50 +0100)
Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). At the same time use is_end_of_stmt() instead of
open-coded nul char checks.

gas/config/tc-arc.c

index 8b69ca6d1f7bae44727b4f4908a1606e454034a7..30d6cb9c50dd92cfb5dff3218cc883508b29a18a 100644 (file)
@@ -1374,10 +1374,6 @@ tokenize_flags (const char *str,
     {
       switch (*input_line_pointer)
        {
-       case ' ':
-       case '\0':
-         goto fini;
-
        case '.':
          input_line_pointer++;
          if (saw_dot)
@@ -1387,6 +1383,10 @@ tokenize_flags (const char *str,
          break;
 
        default:
+         if (is_end_of_stmt (*input_line_pointer)
+             || is_whitespace (*input_line_pointer))
+           goto fini;
+
          if (saw_flg && !saw_dot)
            goto err;
 
@@ -2536,8 +2536,8 @@ md_assemble (char *str)
   /* Scan up to the end of the mnemonic which must end in space or end
      of string.  */
   str += opnamelen;
-  for (; *str != '\0'; str++)
-    if (*str == ' ')
+  for (; !is_end_of_stmt (*str); str++)
+    if (is_whitespace (*str))
       break;
 
   /* Tokenize the rest of the line.  */