Skip to content

Commit

Permalink
test: force trigger segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Nov 10, 2024
1 parent 0dd7da2 commit ab51661
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/optree/treespec.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ using ssize_t = py::ssize_t;
#ifndef Py_C_RECURSION_LIMIT
#define Py_C_RECURSION_LIMIT 1000
#endif
#if !defined(PYPY_VERSION) && !(defined(MS_WINDOWS) && defined(Py_DEBUG))
constexpr ssize_t MAX_RECURSION_DEPTH = std::min(1000, Py_C_RECURSION_LIMIT);
#else
constexpr ssize_t MAX_RECURSION_DEPTH = std::min(500, Py_C_RECURSION_LIMIT);
#endif
// #if !defined(PYPY_VERSION) && !(defined(MS_WINDOWS) && defined(Py_DEBUG))
// constexpr ssize_t MAX_RECURSION_DEPTH = std::min(1000, Py_C_RECURSION_LIMIT);
// #else
// constexpr ssize_t MAX_RECURSION_DEPTH = std::min(500, Py_C_RECURSION_LIMIT);
// #endif
constexpr ssize_t MAX_RECURSION_DEPTH = 100000;

// Test whether the given object is a leaf node.
bool IsLeaf(const py::object &object,
Expand Down

0 comments on commit ab51661

Please sign in to comment.