Skip to content

Commit

Permalink
getInt8PtrTy issue on llvm18
Browse files Browse the repository at this point in the history
  • Loading branch information
expy committed Oct 6, 2024
1 parent 49e5ed8 commit 194ba69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Pluto/IndirectCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ PreservedAnalyses Pluto::IndirectCall::run(Module &M, ModuleAnalysisManager &AM)

std::vector<Constant *> funcAddrs;
for (Function *F : functions) {
funcAddrs.push_back(ConstantExpr::getBitCast(F, Type::getInt8PtrTy(context)));
funcAddrs.push_back(ConstantExpr::getBitCast(F, Type::getInt8Ty(context)->getPointerTo()));
}

// Save function addresses to global variable
ArrayRef<Constant *> funcAddrsRef(funcAddrs);
ArrayType *functionTableType = ArrayType::get(Type::getInt8PtrTy(context), funcAddrs.size());
ArrayType *functionTableType = ArrayType::get(Type::getInt8Ty(context)->getPointerTo(), funcAddrs.size());
Constant *funcAddrsArray = ConstantArray::get(functionTableType, funcAddrsRef);
GlobalVariable *functionTable =
new GlobalVariable(M, functionTableType, false, GlobalVariable::PrivateLinkage, funcAddrsArray);
Expand Down

0 comments on commit 194ba69

Please sign in to comment.