From 87d0b9ed1462705dd9bf1cb7f67d0bf03af776c8 Mon Sep 17 00:00:00 2001 From: Guy Benyei Date: Tue, 12 Feb 2013 21:21:59 +0000 Subject: Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175006 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/LLVMContext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/IR/LLVMContext.cpp') diff --git a/lib/IR/LLVMContext.cpp b/lib/IR/LLVMContext.cpp index 8e2bbb79ee..b73cd03ddd 100644 --- a/lib/IR/LLVMContext.cpp +++ b/lib/IR/LLVMContext.cpp @@ -130,12 +130,13 @@ static bool isValidName(StringRef MDName) { if (MDName.empty()) return false; - if (!std::isalpha(MDName[0])) + if (!std::isalpha(static_cast(MDName[0]))) return false; for (StringRef::iterator I = MDName.begin() + 1, E = MDName.end(); I != E; ++I) { - if (!std::isalnum(*I) && *I != '_' && *I != '-' && *I != '.') + if (!std::isalnum(static_cast(*I)) && *I != '_' && + *I != '-' && *I != '.') return false; } return true; -- cgit v1.2.3