Skip to content

Commit 659c1ed

Browse files
committed
[Async CC] Resigning AFP results in AFP.
Previously, when a FunctionPointer whose kind was AsyncFunctionPointer was resigned, the underlying function pointer was loaded from the AsyncFunctionPointer struct and that value was signed. That was incorrect: a resigned pointer to an AsyncFunctionPointer struct should again be a pointer to an AsyncFunctionPointer struct. Here that error is corrected and the result of resigning is again a pointer to an AsyncFunctionPointer struct.
1 parent 0d93b8d commit 659c1ed

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/IRGen/GenPointerAuth.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ llvm::Value *irgen::emitPointerAuthStrip(IRGenFunction &IGF,
7171
FunctionPointer irgen::emitPointerAuthResign(IRGenFunction &IGF,
7272
const FunctionPointer &fn,
7373
const PointerAuthInfo &newAuthInfo) {
74-
// TODO: Handle resigning AsyncFunctionPointers.
75-
assert(fn.getKind().value == FunctionPointer::KindTy::Value::Function);
76-
llvm::Value *fnPtr = emitPointerAuthResign(IGF, fn.getPointer(IGF),
74+
llvm::Value *fnPtr = emitPointerAuthResign(IGF, fn.getRawPointer(),
7775
fn.getAuthInfo(), newAuthInfo);
7876
return FunctionPointer(fn.getKind(), fnPtr, newAuthInfo, fn.getSignature());
7977
}

0 commit comments

Comments
 (0)