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 compile errors
  • Loading branch information
Hood committed Apr 16, 2021
commit e5fbf978b031b0eb8d8fe528dfd0e8dbeab9ea3b
21 changes: 11 additions & 10 deletions packages/numpy/patches/0001-temp.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
From c3e6532b311101f449c2add064642044e82d535d Mon Sep 17 00:00:00 2001
From 308a7ca2eec1cd90717cf469bbe16c2968383e7a 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 | 33 ++++++++++++++------
2 files changed, 26 insertions(+), 12 deletions(-)
numpy/core/src/multiarray/iterators.c | 32 +++++++++++++++-----
2 files changed, 27 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..e0208b3ed 100644
index 9da811f69..ceabc30fe 100644
--- a/numpy/core/src/multiarray/iterators.c
+++ b/numpy/core/src/multiarray/iterators.c
@@ -1153,17 +1153,12 @@ NPY_NO_EXPORT PyTypeObject PyArrayIter_Type = {
@@ -1153,17 +1153,15 @@ NPY_NO_EXPORT PyTypeObject PyArrayIter_Type = {

/** END of Array Iterator **/

Expand All @@ -47,19 +47,20 @@ index 9da811f69..e0208b3ed 100644
-NPY_NO_EXPORT int
-PyArray_Broadcast(PyArrayMultiIterObject *mit)
-{
- int i, nd, k, j;
- npy_intp tmp;
- PyArrayIterObject *it;
+int
+PyArray_Broadcast_part1(void *mit);
+
+#ifndef __EMSCRIPTEN__
+int
+PyArray_Broadcast_part1(void *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 +1190,24 @@ PyArray_Broadcast(PyArrayMultiIterObject *mit)
@@ -1195,6 +1193,24 @@ PyArray_Broadcast(PyArrayMultiIterObject *mit)
}
}
}
Expand Down