================
@@ -6435,10 +6433,44 @@ llvm::DILocation 
*CodeGenFunction::SanitizerAnnotateDebugInfo(
 #undef SANITIZER_CHECK
   };
 
+  // Label doesn't require sanitization
+
+  return Label;
+}
+
+static std::string
+SanitizerOrdinalToCheckLabel(SanitizerKind::SanitizerOrdinal Ordinal) {
+  std::string Label;
+  switch (Ordinal) {
+#define SANITIZER(NAME, ID)                                                    
\
+  case SanitizerKind::SO_##ID:                                                 
\
+    Label = "__ubsan_check_" NAME;                                             
\
+    break;
+#include "clang/Basic/Sanitizers.def"
+  default:
+    llvm_unreachable("unexpected sanitizer kind");
+  }
+
+  // Sanitize label (convert hyphens to underscores; also futureproof against
+  // non-alpha)
+  for (unsigned int i = 0; i < Label.length(); i++)
+    if (!std::isalpha(Label[i]))
----------------
thurstond wrote:

If our sanitizer names use characters with varying isalpha() results between 
locales, we have bigger problems.

https://github.com/llvm/llvm-project/pull/141997
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to