From: Jan Beulich Date: Mon, 3 Feb 2025 11:22:23 +0000 (+0100) Subject: Sparc: use is_whitespace() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=52da676aa8a89c972a1651e071831d34019627ff;p=thirdparty%2Fbinutils-gdb.git Sparc: use is_whitespace() 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). --- diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index c6f8026e5c1..a22efbf5deb 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1743,13 +1743,15 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) case ',': comma = 1; - /* Fall through. */ - - case ' ': *s++ = '\0'; break; default: + if (is_whitespace (*s)) + { + *s++ = '\0'; + break; + } as_bad (_("Unknown opcode: `%s'"), str); *pinsn = NULL; return special_case; @@ -1798,11 +1800,11 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) goto error; } kmask |= jmask; - while (*s == ' ') + while (is_whitespace (*s)) ++s; if (*s == '|' || *s == '+') ++s; - while (*s == ' ') + while (is_whitespace (*s)) ++s; } } @@ -2039,7 +2041,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) goto immediate; case ')': - if (*s == ' ') + if (is_whitespace (*s)) s++; if ((s[0] == '0' && s[1] == 'x' && ISXDIGIT (s[2])) || ISDIGIT (*s)) @@ -2131,7 +2133,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) break; case 'z': - if (*s == ' ') + if (is_whitespace (*s)) { ++s; } @@ -2144,7 +2146,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) break; case 'Z': - if (*s == ' ') + if (is_whitespace (*s)) { ++s; } @@ -2157,7 +2159,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) break; case '6': - if (*s == ' ') + if (is_whitespace (*s)) { ++s; } @@ -2169,7 +2171,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) break; case '7': - if (*s == ' ') + if (is_whitespace (*s)) { ++s; } @@ -2181,7 +2183,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) break; case '8': - if (*s == ' ') + if (is_whitespace (*s)) { ++s; } @@ -2193,7 +2195,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) break; case '9': - if (*s == ' ') + if (is_whitespace (*s)) { ++s; } @@ -2303,11 +2305,15 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) case '[': /* These must match exactly. */ case ']': case ',': - case ' ': if (*s++ == *args) continue; break; + case ' ': + if (is_whitespace (*s++)) + continue; + break; + case '#': /* Must be at least one digit. */ if (ISDIGIT (*s++)) { @@ -2680,7 +2686,7 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) /* fallthrough */ immediate: - if (*s == ' ') + if (is_whitespace (*s)) s++; {