[llvm] 5e7ad63 - [FuzzMutate] Match the callee's and callsite's calling conventions. (#139100)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 12 10:15:02 PDT 2025
Author: Manuel Carrasco
Date: 2025-05-12T10:14:59-07:00
New Revision: 5e7ad630b09b1c1f7e666f2432ba027a0879981e
URL: https://github.com/llvm/llvm-project/commit/5e7ad630b09b1c1f7e666f2432ba027a0879981e
DIFF: https://github.com/llvm/llvm-project/commit/5e7ad630b09b1c1f7e666f2432ba027a0879981e.diff
LOG: [FuzzMutate] Match the callee's and callsite's calling conventions. (#139100)
The mutator can generate calls with undefined behavior because it is not
matching the calling conventions.
Added:
Modified:
llvm/lib/FuzzMutate/IRMutator.cpp
Removed:
################################################################################
diff --git a/llvm/lib/FuzzMutate/IRMutator.cpp b/llvm/lib/FuzzMutate/IRMutator.cpp
index d5535ee9aaf66..672c666d4e052 100644
--- a/llvm/lib/FuzzMutate/IRMutator.cpp
+++ b/llvm/lib/FuzzMutate/IRMutator.cpp
@@ -391,6 +391,7 @@ void InsertFunctionStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) {
BasicBlock::iterator InsertPt) {
StringRef Name = isRetVoid ? nullptr : "C";
CallInst *Call = CallInst::Create(FTy, F, Srcs, Name, InsertPt);
+ Call->setCallingConv(F->getCallingConv());
// Don't return this call inst if it return void as it can't be sinked.
return isRetVoid ? nullptr : Call;
};
More information about the llvm-commits
mailing list