Commits

Antonio Cuni  committed 9d3fd2d

add an assertion

  • Participants
  • Parent commits 3ab160d

Comments (0)

Files changed (1)

 #include <Python.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <assert.h>
 #include "fakenumpy.h"
 
 static PyObject*
     PyObject *obj = PyObject_CallObject((PyObject *) &PyArray_Type, NULL);
     PyArrayObject* array = (PyArrayObject*)obj;
     int i;
+    assert(nd<=10); // this is the size of the array in PyArrayObject
     array->ndims = nd;
     for(i=0; i<nd; i++)
         array->dims[i] = dims[i];