[objc-gnustep2] Use unsigned char to avoid potential UB in isalnum.
authorDavid Chisnall <csdavec@swan.ac.uk>
Tue, 22 May 2018 10:13:17 +0000 (10:13 +0000)
committerDavid Chisnall <csdavec@swan.ac.uk>
Tue, 22 May 2018 10:13:17 +0000 (10:13 +0000)
Suggested by Gabor Buella.

llvm-svn: 332966

clang/lib/CodeGen/CGObjCGNU.cpp

index 1c1abe9..6a0554b 100644 (file)
@@ -1053,7 +1053,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep {
     if (isNamed) {
       StringName = ".objc_str_";
       for (int i=0,e=Str.size() ; i<e ; ++i) {
-        char c = Str[i];
+        unsigned char c = Str[i];
         if (isalnum(c))
           StringName += c;
         else if (c == ' ')