We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 677b430 commit 44dde15Copy full SHA for 44dde15
compiler/rustc_codegen_llvm/src/common.rs
@@ -95,7 +95,8 @@ impl<'ll> BackendTypes for CodegenCx<'ll, '_> {
95
96
impl<'ll> CodegenCx<'ll, '_> {
97
pub fn const_array(&self, ty: &'ll Type, elts: &[&'ll Value]) -> &'ll Value {
98
- unsafe { llvm::LLVMConstArray2(ty, elts.as_ptr(), elts.len()) }
+ let len = u64::try_from(elts.len()).expect("LLVMConstArray2 elements len overflow");
99
+ unsafe { llvm::LLVMConstArray2(ty, elts.as_ptr(), len) }
100
}
101
102
pub fn const_vector(&self, elts: &[&'ll Value]) -> &'ll Value {
0 commit comments