[clang] [HIP] Fix ubsan function checks applied to kernel functions (PR #188872)
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 3 09:16:47 PDT 2026
================
@@ -1033,9 +1033,11 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
}
// If we are checking function types, emit a function type signature as
- // prologue data.
+ // prologue data. Kernel functions have strict alignment requirements and
+ // cannot be call indirectly so we do not instrument them.
if (FD && SanOpts.has(SanitizerKind::Function) &&
- !FD->getType()->isCFIUncheckedCalleeFunctionType()) {
+ !FD->getType()->isCFIUncheckedCalleeFunctionType() &&
+ !Fn->hasKernelCallingConv()) {
----------------
arsenm wrote:
Should this be broadened to an is-callable check of some kind
https://github.com/llvm/llvm-project/pull/188872
More information about the cfe-commits
mailing list