pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/736fe4d23e267a70d3b769046f03c1f3bdc0f430

5097560d244c08.css" /> gh-117139: Fix a few `_PyStackRef` related bugs (#122831) · python/cpython@736fe4d · GitHub
Skip to content

Commit 736fe4d

Browse files
gh-117139: Fix a few _PyStackRef related bugs (#122831)
`BUILD_SET` should use a borrow instead of a steal. The cleanup in `_DO_CALL` `CONVERSION_FAILED` was incorrect. Co-authored-by: Ken Jin <kenjin@python.org>
1 parent be90648 commit 736fe4d

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

Python/bytecodes.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,11 +1714,10 @@ dummy_func(
17141714
}
17151715
int err = 0;
17161716
for (int i = 0; i < oparg; i++) {
1717-
PyObject *item = PyStackRef_AsPyObjectSteal(values[i]);
17181717
if (err == 0) {
1719-
err = PySet_Add(set_o, item);
1718+
err = PySet_Add(set_o, PyStackRef_AsPyObjectBorrow(values[i]));
17201719
}
1721-
Py_DECREF(item);
1720+
PyStackRef_CLOSE(values[i]);
17221721
}
17231722
if (err != 0) {
17241723
Py_DECREF(set_o);
@@ -3235,7 +3234,10 @@ dummy_func(
32353234
/* Callable is not a normal Python function */
32363235
STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
32373236
if (CONVERSION_FAILED(args_o)) {
3238-
DECREF_INPUTS();
3237+
PyStackRef_CLOSE(callable);
3238+
for (int i = 0; i < total_args; i++) {
3239+
PyStackRef_CLOSE(args[i]);
3240+
}
32393241
ERROR_IF(true, error);
32403242
}
32413243
PyObject *res_o = PyObject_Vectorcall(

Python/executor_cases.c.h

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy