Skip to content

Commit 6f1569d

Browse files
committed
Fix selection in simd_shuffle to use input len
1 parent ff40897 commit 6f1569d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kani-compiler/src/codegen_cprover_gotoc/codegen/intrinsic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ impl<'tcx> GotocCtx<'tcx> {
17291729
// [u32; n]: translated wrapped in a struct
17301730
let indexes = fargs.remove(0);
17311731

1732-
let (_, vec_subtype) = rust_arg_types[0].simd_size_and_type(self.tcx);
1732+
let (in_type_len, vec_subtype) = rust_arg_types[0].simd_size_and_type(self.tcx);
17331733
let (ret_type_len, ret_type_subtype) = rust_ret_type.simd_size_and_type(self.tcx);
17341734
if ret_type_len != n {
17351735
let err_msg = format!(
@@ -1749,7 +1749,7 @@ impl<'tcx> GotocCtx<'tcx> {
17491749
// An unsigned type here causes an invariant violation in CBMC.
17501750
// Issue: https://github.com/diffblue/cbmc/issues/6298
17511751
let st_rep = Type::ssize_t();
1752-
let n_rep = Expr::int_constant(n, st_rep.clone());
1752+
let n_rep = Expr::int_constant(in_type_len, st_rep.clone());
17531753

17541754
// P = indexes.expanded_map(v -> if v < N then vec1[v] else vec2[v-N])
17551755
let elems = (0..n)

0 commit comments

Comments
 (0)