We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d8e302 commit 21bcd3fCopy full SHA for 21bcd3f
pgrx/src/array/flat_array.rs
@@ -122,6 +122,8 @@ where
122
let mut product = 1 as ffi::c_int;
123
let mut lbounds = [0 as ffi::c_int; N];
124
for (&dim, lbound) in dim_lens.iter().zip(lbounds.iter_mut()) {
125
+ // current lower bound is last product
126
+ *lbound = product;
127
// We handle the multiplication as usize, then use try_from to fit it down,
128
// to avoid a risk of an unguarded overflow happening from casts
129
product = if let Some(val) = dim.checked_mul(product as usize)
@@ -131,7 +133,6 @@ where
131
133
} else {
132
134
return Err(ArrayAllocError::TooManyElems);
135
};
- *lbound = product;
136
}
137
let nelems = product as usize;
138
if nelems > MAX_ARRAY_SIZE {
0 commit comments