|
@@ -1289,9 +1289,10 @@ lbValue lb_build_builtin_simd_proc(lbProcedure *p, Ast *expr, TypeAndValue const
|
|
|
|
|
|
i64 indices_count = ce->args.count-2;
|
|
i64 indices_count = ce->args.count-2;
|
|
i64 max_count = vt->SimdVector.count*2;
|
|
i64 max_count = vt->SimdVector.count*2;
|
|
|
|
+ GB_ASSERT(indices_count <= max_count);
|
|
|
|
|
|
LLVMValueRef *values = gb_alloc_array(temporary_allocator(), LLVMValueRef, indices_count);
|
|
LLVMValueRef *values = gb_alloc_array(temporary_allocator(), LLVMValueRef, indices_count);
|
|
- for (isize i = 0; i < max_count; i++) {
|
|
|
|
|
|
+ for (isize i = 0; i < indices_count; i++) {
|
|
lbValue idx = lb_build_expr(p, ce->args[i+2]);
|
|
lbValue idx = lb_build_expr(p, ce->args[i+2]);
|
|
GB_ASSERT(LLVMIsConstant(idx.value));
|
|
GB_ASSERT(LLVMIsConstant(idx.value));
|
|
values[i] = idx.value;
|
|
values[i] = idx.value;
|