Skip to content

Commit

Permalink
Hopefully fix UB
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Apr 14, 2024
1 parent 6081b49 commit 388646a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,10 @@ extern "C" LLVMValueRef LLVMRustBuildCall(LLVMBuilderRef B, LLVMTypeRef Ty, LLVM
FunctionType *FTy = unwrap<FunctionType>(Ty);
return wrap(unwrap(B)->CreateCall(
FTy, Callee, ArrayRef<Value*>(unwrap(Args), NumArgs),
ArrayRef<OperandBundleDef>(*OpBundles, NumOpBundles)));
NumOpBundles == 0 ?
ArrayRef<OperandBundleDef>() :
// FIXME: This signature is just wrong, no idea how this ever worked.
ArrayRef<OperandBundleDef>(*OpBundles, NumOpBundles)));
}

extern "C" LLVMValueRef LLVMRustGetInstrProfIncrementIntrinsic(LLVMModuleRef M) {
Expand Down

0 comments on commit 388646a

Please sign in to comment.