Skip to content

Commit

Permalink
Only auth indirect call operands
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-fink committed Apr 30, 2024
1 parent 9550001 commit 0a8fd50
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions llvm/lib/Target/WebAssembly/WebAssemblyPointerAuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,17 @@ bool WebAssemblyPointerAuth::runOnModule(Module &M) {
}

void WebAssemblyPointerAuth::visitCallBase(llvm::CallBase &CB) {
if (!CB.isIndirectCall()) {
return;
}
auto *Op = CB.getCalledOperand();
if (isa<Function>(Op)) {
return;
llvm_unreachable("Expected Op to be a function pointer.");
}

// otherwise, we assume Op is a function pointer
if (!Op->getType()->isPointerTy()) {
errs() << "Expected Op to be a function pointer.";
llvm_unreachable("Expected Op to be a function pointer.");
}

auto *PointerAuthIntr =
Expand Down

0 comments on commit 0a8fd50

Please sign in to comment.