r332966 - [objc-gnustep2] Use unsigned char to avoid potential UB in isalnum.
David Chisnall via cfe-commits
cfe-commits at lists.llvm.org
Tue May 22 03:13:17 PDT 2018
Author: theraven
Date: Tue May 22 03:13:17 2018
New Revision: 332966
URL: http://llvm.org/viewvc/llvm-project?rev=332966&view=rev
Log:
[objc-gnustep2] Use unsigned char to avoid potential UB in isalnum.
Suggested by Gabor Buella.
Modified:
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=332966&r1=332965&r2=332966&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Tue May 22 03:13:17 2018
@@ -1053,7 +1053,7 @@ class CGObjCGNUstep2 : public CGObjCGNUs
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 == ' ')
More information about the cfe-commits
mailing list