summaryrefslogtreecommitdiffstatshomepage
path: root/py/pystack.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/pystack.c')
-rw-r--r--py/pystack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/pystack.c b/py/pystack.c
index 767c307e9a..552e59d537 100644
--- a/py/pystack.c
+++ b/py/pystack.c
@@ -43,7 +43,8 @@ void *mp_pystack_alloc(size_t n_bytes) {
#endif
if (MP_STATE_THREAD(pystack_cur) + n_bytes > MP_STATE_THREAD(pystack_end)) {
// out of memory in the pystack
- mp_raise_recursion_depth();
+ nlr_raise(mp_obj_new_exception_arg1(&mp_type_RuntimeError,
+ MP_OBJ_NEW_QSTR(MP_QSTR_pystack_space_exhausted)));
}
void *ptr = MP_STATE_THREAD(pystack_cur);
MP_STATE_THREAD(pystack_cur) += n_bytes;