mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
fix rangecheck
This commit is contained in:
parent
be40a4d3f1
commit
5ffab34d13
@ -65,7 +65,7 @@ namespace ngcore
|
||||
if (!slice.compute(self.Size(), &start, &stop, &step, &slicelength))
|
||||
throw py::error_already_set();
|
||||
static constexpr int base = IndexBASE<TIND>();
|
||||
if (start < base || start+slicelength*step >= self.Size()+base)
|
||||
if (start < base || start+(slicelength-1)*step >= self.Size()+base)
|
||||
throw py::index_error();
|
||||
for (size_t i = 0; i < slicelength; i++, start+=step)
|
||||
self[start] = val;
|
||||
|
Loading…
Reference in New Issue
Block a user