Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory access out of bounds in numpy + chrome 89 #1474

Merged
merged 23 commits into from
Apr 17, 2021
Merged
Prev Previous commit
Next Next commit
Fix native build error
  • Loading branch information
Hood committed Apr 16, 2021
commit e0ba4bec6131f1679fc8242882ea24b542ddc2ef
13 changes: 7 additions & 6 deletions packages/numpy/patches/0001-temp.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
From 308a7ca2eec1cd90717cf469bbe16c2968383e7a Mon Sep 17 00:00:00 2001
From 85906e04a09acadadaf364937ac6c4d384b5a2eb Mon Sep 17 00:00:00 2001
From: Hood <hood@mit.edu>
Date: Thu, 15 Apr 2021 21:14:55 -0700
Subject: [PATCH] temp

---
numpy/core/src/multiarray/conversion_utils.c | 5 +--
numpy/core/src/multiarray/iterators.c | 32 +++++++++++++++-----
2 files changed, 27 insertions(+), 10 deletions(-)
numpy/core/src/multiarray/iterators.c | 33 +++++++++++++++-----
2 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c
index 52cb58726..5467f4d78 100644
Expand All @@ -33,10 +33,10 @@ index 52cb58726..5467f4d78 100644
}
return nd;
diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c
index 9da811f69..ceabc30fe 100644
index 9da811f69..a801c221a 100644
--- a/numpy/core/src/multiarray/iterators.c
+++ b/numpy/core/src/multiarray/iterators.c
@@ -1153,17 +1153,15 @@ NPY_NO_EXPORT PyTypeObject PyArrayIter_Type = {
@@ -1153,17 +1153,16 @@ NPY_NO_EXPORT PyTypeObject PyArrayIter_Type = {

/** END of Array Iterator **/

Expand All @@ -53,14 +53,15 @@ index 9da811f69..ceabc30fe 100644
+#ifndef __EMSCRIPTEN__
+int
+PyArray_Broadcast_part1(void *mit_void){
+ PyArrayMultiIterObject *mit = (PyArrayMultiIterObject *)mit_void;
int i, nd, k, j;
npy_intp tmp;
PyArrayIterObject *it;
-
/* Discover the broadcast number of dimensions */
for (i = 0, nd = 0; i < mit->numiter; i++) {
nd = PyArray_MAX(nd, PyArray_NDIM(mit->iters[i]->ao));
@@ -1195,6 +1193,24 @@ PyArray_Broadcast(PyArrayMultiIterObject *mit)
@@ -1195,6 +1194,24 @@ PyArray_Broadcast(PyArrayMultiIterObject *mit)
}
}
}
Expand Down