Title: Refactor `codegen_deferred_annotations_body` to ensure `mangled` is decref'd · Issue #148059 · python/cpython · GitHub
Open Graph Title: Refactor `codegen_deferred_annotations_body` to ensure `mangled` is decref'd · Issue #148059 · python/cpython
X Title: Refactor `codegen_deferred_annotations_body` to ensure `mangled` is decref'd · Issue #148059 · python/cpython
Description: Bug report Bug description: Follow-up item from this PR: #146443 (review) During error cases we may fail to decref mangled while using these ADDOP* and VISIT macros. As a result, we can extract the for loop's body into a subfunction that...
Open Graph Description: Bug report Bug description: Follow-up item from this PR: #146443 (review) During error cases we may fail to decref mangled while using these ADDOP* and VISIT macros. As a result, we can extract the...
X Description: Bug report Bug description: Follow-up item from this PR: #146443 (review) During error cases we may fail to decref mangled while using these ADDOP* and VISIT macros. As a result, we can extract the...
Opengraph URL: https://github.com/python/cpython/issues/148059
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Refactor `codegen_deferred_annotations_body` to ensure `mangled` is decref'd","articleBody":"# Bug report\n\n### Bug description:\n\nFollow-up item from this PR: https://github.com/python/cpython/pull/146443#pullrequestreview-4033013919\n\nDuring error cases we may fail to decref mangled while using these `ADDOP*` and `VISIT` macros. As a result, we can extract the for loop's body into a subfunction that we check the return of and decref mangled if needed.\n\n```C\n // NOTE: ref of mangled can be leaked on ADDOP* and VISIT macros due to early returns\n // fixing would require an overhaul of these macros\n```\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nWindows\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-148060\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/A0su","@type":"Person","name":"A0su"},"datePublished":"2026-04-03T22:08:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/148059/cpython/issues/148059"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:08c1b75a-8474-0480-e94e-cde6f513efaf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E39E:C3948:A399FE9:E637DA3:6A50E7BE |
| html-safe-nonce | b646b62e2b98c8940e3104a459aa6b853e1ea4e2795fc30111a47a2dd9ca592e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzlFOkMzOTQ4OkEzOTlGRTk6RTYzN0RBMzo2QTUwRTdCRSIsInZpc2l0b3JfaWQiOiIyNTI5NDI3NTE5Mzg5NjI0MjU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | be9d4e7b72723c20f59aa38154746ab3c804deaf489a0e86cba824cdcaeff51c |
| hovercard-subject-tag | issue:4202377121 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/148059/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6f04a3304bf4afaff68dc7962727cd63b2e172dca6125530df0d44c59e7cd970/python/cpython/issues/148059 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6f04a3304bf4afaff68dc7962727cd63b2e172dca6125530df0d44c59e7cd970/python/cpython/issues/148059 |
| og:image:alt | Bug report Bug description: Follow-up item from this PR: #146443 (review) During error cases we may fail to decref mangled while using these ADDOP* and VISIT macros. As a result, we can extract the... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | A0su |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fb19d617b534959801b4b7453938ecf1dfa22131 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width