Cleanup: incorrect assertion
This assertion was added in assumption that sizes of input argument are always correct. But this is not such. More correct is to depend on assertions of span access methods. The size of the multi-function parameters is only guaranteed to be large enough so that every index in the mask can be accessed. It may be larger. Pull Request: https://projects.blender.org/blender/blender/pulls/121393
This commit is contained in:
committed by
Jacques Lucke
parent
8203184192
commit
4732e7cda5
@@ -50,7 +50,6 @@ static void copy_with_stride(const IndexMask &mask,
|
||||
{
|
||||
BLI_assert(src_begin < src_step);
|
||||
BLI_assert(dst_begin < dst_step);
|
||||
BLI_assert(src.size() / src_step == dst.size() / dst_step);
|
||||
devirtualize_varray(src, [&](const auto src) {
|
||||
mask.foreach_index_optimized<int>([&](const int64_t index) {
|
||||
dst[dst_begin + dst_step * index] = src[src_begin + src_step * index];
|
||||
|
||||
@@ -54,7 +54,6 @@ static void copy_with_stride(const IndexMask &mask,
|
||||
}
|
||||
BLI_assert(src_begin < src_step);
|
||||
BLI_assert(dst_begin < dst_step);
|
||||
BLI_assert(src.size() / src_step == dst.size() / dst_step);
|
||||
mask.foreach_index_optimized<int>([&](const int64_t index) {
|
||||
dst[dst_begin + dst_step * index] = src[src_begin + src_step * index];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user