Visitar URL original
Stackless issue #200: fix PyTasklet_Run_nr() and PyTasklet_Switch_nr() · akruis/cpython@5cbfbe2 · GitHub
Skip to content

Commit 5cbfbe2

Browse files
committed
Stackless issue python#200: fix PyTasklet_Run_nr() and PyTasklet_Switch_nr()
Fix a bug in the C-API functions PyTasklet_Run_nr() and PyTasklet_Switch_nr(). Under exotic conditions the functions could cause undefined behavior. (cherry picked from commit 3629160)
1 parent 650229f commit 5cbfbe2

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎Stackless/changelog.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ What's New in Stackless 3.X.X?
99

1010
*Release date: 20XX-XX-XX*
1111

12+
- https://github.com/stackless-dev/stackless/issues/200
13+
Fix a bug in the C-API functions PyTasklet_Run_nr() and
14+
PyTasklet_Switch_nr(). Under exotic conditions the functions could
15+
cause undefined behavior.
16+
1217
- https://github.com/stackless-dev/stackless/issues/193
1318
Fix the macros PyTasklet_CheckExact(op) and PyChannel_CheckExact(op).
1419
Previously they contained a reference to a non existing variable.

‎Stackless/module/taskletobject.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ impl_tasklet_run_remove(PyTaskletObject *task, int remove);
800800
int
801801
PyTasklet_Run_nr(PyTaskletObject *task)
802802
{
803-
slp_try_stackless = 1;
803+
STACKLESS_PROPOSE_ALL();
804804
return slp_return_wrapper(impl_tasklet_run_remove(task, 0));
805805
}
806806

@@ -929,7 +929,7 @@ PyTasklet_Switch_M(PyTaskletObject *task)
929929
int
930930
PyTasklet_Switch_nr(PyTaskletObject *task)
931931
{
932-
slp_try_stackless = 1;
932+
STACKLESS_PROPOSE_ALL();
933933
return slp_return_wrapper(impl_tasklet_run_remove(task, 1));
934934
}
935935

0 commit comments

Comments
 (0)