Skip to content

loads and stores with vectors can read/write more than the vector size #145

@sarah-quinones

Description

@sarah-quinones

this function, for example

#define SIMDPP_ARCH_X86_AVX2
#include <simdpp/simd.h>

void sum(double* out, double const* lhs, double const* rhs) {
  using vec_t = simdpp::float64<1>;
  auto l = simdpp::load_u<vec_t>(lhs);
  auto r = simdpp::load_u<vec_t>(rhs);
  simdpp::store_u(out, l + r);
}

will load and write 4 doubles instead of a single one, which may result in an unexpected buffer overflow. is this the intended behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions