[llvm] [DataFlowSanitizer] Properly add ext attributes on arguments as needed. (PR #225443)
Jonas Paulsson via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 29 05:33:58 PDT 2026
================
@@ -3138,6 +3167,26 @@ bool DFSanVisitor::visitWrappedCallBase(Function &F, CallBase &CB) {
if (Function *CustomFn = dyn_cast<Function>(CustomF.getCallee())) {
CustomFn->copyAttributesFrom(&F);
+ // Ensure all narrow integer arguments (both original and added
+ // shadow/origin) have an extension attribute on the function
+ // declaration. If none is present, add the right attribute for zero
+ // extend as all DFSan args are unsigned. TODO: Avoid getting here with
+ // missing attributes in the first place (use TLI/emitLibFunc()?).
----------------
JonPsson1 wrote:
I actually also get this in compiler-rt (trace-cmp.c):
```
# .---command stderr------------
# | ERROR: Missing extension attribute of passed value in call to function:
# | Callee: void @__dfsw___sanitizer_cov_trace_const_cmp4(i8 zeroext, i8 zeroext, i8, i8)
# | Caller: void @dfsw$__dfsw___sanitizer_cov_trace_const_cmp4(i8 zeroext, i8 zeroext, i8 zeroext, i8 zeroext)
# |
```
https://github.com/llvm/llvm-project/pull/225443
More information about the llvm-commits
mailing list