Skip to content

Commit

Permalink
merge 3.3-slp (Stackless python#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anselm Kruis committed Nov 14, 2016
2 parents 79f0e11 + cc52455 commit 476232b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Objects/abstract.c
Original file line number Diff line number Diff line change
Expand Up @@ -2681,6 +2681,7 @@ PyIter_Next(PyObject *iter)
STACKLESS_PROMOTE_METHOD(iter, tp_iternext);
result = (*iter->ob_type->tp_iternext)(iter);
STACKLESS_ASSERT();
STACKLESS_ASSERT_UNWINDING_VALUE_IS_NOT(result, NULL);
if (result == NULL &&
PyErr_Occurred() &&
PyErr_ExceptionMatches(PyExc_StopIteration))
Expand Down
1 change: 1 addition & 0 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5460,6 +5460,7 @@ wrap_next(PyObject *self, PyObject *args, void *wrapped)
STACKLESS_PROMOTE_ALL();
res = (*func)(self);
STACKLESS_ASSERT();
STACKLESS_ASSERT_UNWINDING_VALUE_IS_NOT(res, NULL);
if (res == NULL && !PyErr_Occurred())
PyErr_SetNone(PyExc_StopIteration);
return res;
Expand Down
4 changes: 4 additions & 0 deletions Stackless/core/stackless_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ PyAPI_FUNC(PyTaskletObject *) slp_get_watchdog(PyThreadState *ts, int interrupt)
#define STACKLESS_RETVAL(obj) \
(STACKLESS_UNWINDING(obj) ? Py_UnwindToken->tempval : (obj))

#define STACKLESS_ASSERT_UNWINDING_VALUE_IS_NOT(obj, val) \
assert(!STACKLESS_UNWINDING(obj) || ((Py_UnwindToken->tempval) != (val)))

/* macros for setting/resetting the stackless flag */

#define STACKLESS_GETARG() int stackless = (stackless = slp_try_stackless, \
Expand Down Expand Up @@ -555,6 +558,7 @@ PyObject * slp_get_channel_callback(void);
#define STACKLESS_ASSERT() assert(1)

#define STACKLESS_RETVAL(obj) (obj)
#define STACKLESS_ASSERT_UNWINDING_VALUE_IS_NOT(val) assert(1)

#define STACKLESS_DECLARE_METHOD(type, meth)

Expand Down

0 comments on commit 476232b

Please sign in to comment.