summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-06-02 10:46:18 (GMT)
committerGitHub <noreply@github.com>2023-06-02 10:46:18 (GMT)
commit4bfa01b9d911ce9358cf1a453bee15554f8e4c07 (patch)
treebd61d8459bf30d42abf0be7258de91360bea434b /Objects
parent601ae09f0c8eda213b9050892f5ce9b91f0aa522 (diff)
downloadcpython-4bfa01b9d911ce9358cf1a453bee15554f8e4c07.zip
cpython-4bfa01b9d911ce9358cf1a453bee15554f8e4c07.tar.gz
cpython-4bfa01b9d911ce9358cf1a453bee15554f8e4c07.tar.bz2
GH-104584: Plugin optimizer API (GH-105100)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/codeobject.c7
-rw-r--r--Objects/frameobject.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index ebae0a3..cf087e8 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -433,6 +433,7 @@ init_code(PyCodeObject *co, struct _PyCodeConstructor *con)
co->co_weakreflist = NULL;
co->co_extra = NULL;
co->_co_cached = NULL;
+ co->co_executors = NULL;
memcpy(_PyCode_CODE(co), PyBytes_AS_STRING(con->code),
PyBytes_GET_SIZE(con->code));
@@ -1677,6 +1678,12 @@ code_dealloc(PyCodeObject *co)
PyMem_Free(co_extra);
}
+ if (co->co_executors != NULL) {
+ for (int i = 0; i < co->co_executors->size; i++) {
+ Py_CLEAR(co->co_executors->executors[i]);
+ }
+ PyMem_Free(co->co_executors);
+ }
Py_XDECREF(co->co_consts);
Py_XDECREF(co->co_names);
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 2c90a6b..f2061e6 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -348,7 +348,7 @@ mark_stacks(PyCodeObject *code_obj, int len)
break;
case JUMP_BACKWARD:
case JUMP_BACKWARD_NO_INTERRUPT:
- j = i + 1 - oparg;
+ j = next_i - oparg;
assert(j >= 0);
assert(j < len);
if (stacks[j] == UNINITIALIZED && j < i) {