Skip to content

Commit d989121

Browse files
Hopefully fix UB
1 parent 6081b49 commit d989121

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ extern "C" LLVMValueRef LLVMRustBuildCall(LLVMBuilderRef B, LLVMTypeRef Ty, LLVM
15301530
FunctionType *FTy = unwrap<FunctionType>(Ty);
15311531
return wrap(unwrap(B)->CreateCall(
15321532
FTy, Callee, ArrayRef<Value*>(unwrap(Args), NumArgs),
1533-
ArrayRef<OperandBundleDef>(*OpBundles, NumOpBundles)));
1533+
NumOpBundles == 0 ? ArrayRef<OperandBundleDef>() : ArrayRef<OperandBundleDef>(*OpBundles, NumOpBundles)));
15341534
}
15351535

15361536
extern "C" LLVMValueRef LLVMRustGetInstrProfIncrementIntrinsic(LLVMModuleRef M) {

0 commit comments

Comments
 (0)