Skip to content

[NFC][BoundsChecking] Address #122576 review comments #122773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

vitalybuka
Copy link
Collaborator

No description provided.

Created using spr 1.3.4
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. labels Jan 13, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 13, 2025

@llvm/pr-subscribers-clang-codegen

@llvm/pr-subscribers-clang

Author: Vitaly Buka (vitalybuka)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/122773.diff

2 Files Affected:

  • (modified) clang/lib/CodeGen/BackendUtil.cpp (+2-1)
  • (modified) llvm/lib/Passes/PassBuilder.cpp (+1-1)
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 79e6bf3d24dffb..3951ad01497cca 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -1032,7 +1032,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
           static_assert(SanitizerKind::SO_LocalBounds <=
                             std::numeric_limits<
                                 decltype(Options.GuardKind)::value_type>::max(),
-                        "Update type of llvm.allow.ubsan.check.");
+                        "Update type of llvm.allow.ubsan.check to represent "
+                        "SanitizerKind::SO_LocalBounds.");
           Options.GuardKind = SanitizerKind::SO_LocalBounds;
         }
         Options.Merge =
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index f923d5aabe0a0e..a0bfcef6ce01a8 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1318,7 +1318,7 @@ parseBoundsCheckingOptions(StringRef Params) {
       StringRef ParamEQ;
       StringRef Val;
       std::tie(ParamEQ, Val) = ParamName.split('=');
-      int8_t Id = 0;
+      int8_t Id;
       if (ParamEQ == "guard" && !Val.getAsInteger(0, Id)) {
         Options.GuardKind = Id;
       } else {

@vitalybuka vitalybuka requested a review from fmayer January 13, 2025 19:31
@vitalybuka vitalybuka merged commit e7f756d into main Jan 15, 2025
11 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/nfcboundschecking-address-122576-review-comments branch January 15, 2025 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants