summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/frame.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/frame.c b/Python/frame.c
index ec390e7..2bb1282 100644
--- a/Python/frame.c
+++ b/Python/frame.c
@@ -98,10 +98,11 @@ void
_PyFrame_ClearLocals(_PyInterpreterFrame *frame)
{
assert(frame->stacktop >= 0);
- for (int i = 0; i < frame->stacktop; i++) {
+ int stacktop = frame->stacktop;
+ frame->stacktop = 0;
+ for (int i = 0; i < stacktop; i++) {
Py_XDECREF(frame->localsplus[i]);
}
- frame->stacktop = 0;
Py_CLEAR(frame->f_locals);
}