aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ValueMapper.cpp
diff options
context:
space:
mode:
authorAnatoly Trosinenko <atrosinenko@accesssoftek.com>2025-02-28 23:48:01 +0300
committerGitHub <noreply@github.com>2025-02-28 12:48:01 -0800
commit88ae5bd13b1206871f6639b18f1fde03f2ca7adc (patch)
tree4483c75ca47f8841c24192f0f8c0d708458ac55d /llvm/lib/Transforms/Utils/ValueMapper.cpp
parentf9b249705598b31d2313458207668eeae896e4c6 (diff)
downloadllvm-88ae5bd13b1206871f6639b18f1fde03f2ca7adc.zip
llvm-88ae5bd13b1206871f6639b18f1fde03f2ca7adc.tar.gz
llvm-88ae5bd13b1206871f6639b18f1fde03f2ca7adc.tar.bz2
[PAC] Make ValueMapper handle ConstantPtrAuth values (#129088)
Fix assertion failure when building PAuth-hardened code with LTO. W/o assertions we end with invalid codegen.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ValueMapper.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index b856945..9882f81 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -525,6 +525,9 @@ Value *Mapper::mapValue(const Value *V) {
return getVM()[V] = ConstantStruct::get(cast<StructType>(NewTy), Ops);
if (isa<ConstantVector>(C))
return getVM()[V] = ConstantVector::get(Ops);
+ if (isa<ConstantPtrAuth>(C))
+ return getVM()[V] = ConstantPtrAuth::get(Ops[0], cast<ConstantInt>(Ops[1]),
+ cast<ConstantInt>(Ops[2]), Ops[3]);
// If this is a no-operand constant, it must be because the type was remapped.
if (isa<PoisonValue>(C))
return getVM()[V] = PoisonValue::get(NewTy);