Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9807068

Browse filesBrowse files
committed
Merge pull request #5168 from jkseppan/fix-5105-again
FIX: a bounds check
2 parents 2184f63 + 09fa9a9 commit 9807068
Copy full SHA for 9807068

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎src/numpy_cpp.h

Copy file name to clipboardExpand all lines: src/numpy_cpp.h
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ class array_view_accessors<AV, T, 3>
331331

332332
};
333333

334+
// When adding instantiations of array_view_accessors, remember to add entries
335+
// to zeros[] below.
336+
334337
}
335338

336339
static npy_intp zeros[] = { 0, 0, 0 };
@@ -470,7 +473,7 @@ class array_view : public detail::array_view_accessors<array_view, T, ND>
470473

471474
npy_intp dim(size_t i) const
472475
{
473-
if (i > ND) {
476+
if (i >= ND) {
474477
return 0;
475478
}
476479
return m_shape[i];

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.