[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 20 16:29:52 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timothy Herchen (anematode)
<details>
<summary>Changes</summary>
Fixes https://github.com/llvm/llvm-project/issues/144857 . I can create a test if desired, but I think the fix is trivial enough.
<img width="805" height="105" alt="image" src="https://github.com/user-attachments/assets/aaee8e5f-6e65-4f04-b8b9-e4ae1434d958" />
---
Full diff: https://github.com/llvm/llvm-project/pull/149745.diff
1 Files Affected:
- (modified) clang/lib/Sema/SemaX86.cpp (+5)
``````````diff
diff --git a/clang/lib/Sema/SemaX86.cpp b/clang/lib/Sema/SemaX86.cpp
index 5c149bdec7073..6bb3558972126 100644
--- a/clang/lib/Sema/SemaX86.cpp
+++ b/clang/lib/Sema/SemaX86.cpp
@@ -954,6 +954,11 @@ bool SemaX86::CheckBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
l = 0;
u = 15;
break;
+ case X86::BI__builtin_ia32_prefetchi:
+ i = 1;
+ l = 2; // _MM_HINT_T1
+ u = 3; // _MM_HINT_T0
+ break;
}
// Note that we don't force a hard error on the range check here, allowing
``````````
</details>
https://github.com/llvm/llvm-project/pull/149745
More information about the cfe-commits
mailing list