Title: gh-146442: Fix various bugs in compiler pipeline from bug report by A0su · Pull Request #146443 · python/cpython · GitHub
Open Graph Title: gh-146442: Fix various bugs in compiler pipeline from bug report by A0su · Pull Request #146443 · python/cpython
X Title: gh-146442: Fix various bugs in compiler pipeline from bug report by A0su · Pull Request #146443 · python/cpython
Description: Compiler Pipeline (codegen + compile + symtable + flowgraph + assemble) | 6 FIX codegen.c (6,632 lines) — 4 FIX NULL deref + ref leak in codegen_setup_annotations_scope (line 716-720): PyLong_FromLong result not NULL-checked, passed to ADDOP_LOAD_CONST which dereferences it. Also never DECREF'd even on success. Ref leak of mangled in codegen_nameop (line 3280): RETURN_IF_ERROR(scope) early-returns without DECREF'ing mangled from _PyCompile_MaybeMangle. Unchecked _PyCompile_PushFBlock in codegen_unwind_fblock_stack (line 669): Return value silently discarded, error lost, frame block stack left inconsistent. compile.c (1,772 lines) — 1 FIX Ref leak of orig in _PyCompile_TweakInlinedComprehensionScopes (line 1096-1114): PyDict_GetItemRef returns new ref in orig, never DECREF'd on any path (success or error). Leaks on every inlined comprehension. assemble.c (802 lines) — 1 FIX assemble_emit_instr returns ERROR without exception (line 420-421): Bytecode overflow check returns ERROR without PyErr_NoMemory() → SystemError. symtable.c (3,355 lines) — 0 FIX (clean) flowgraph.c (4,088 lines) — 0 FIX (clean) Did not fix Ref leak of mangled in codegen_deferred_annotations_body (line 792-818) I do not see a simple way to fix this without overhauling the macros (ADDOP* & VISIT) that can early return Issue: gh-146102 Issue: gh-146442
Open Graph Description: Compiler Pipeline (codegen + compile + symtable + flowgraph + assemble) | 6 FIX codegen.c (6,632 lines) — 4 FIX NULL deref + ref leak in codegen_setup_annotations_scope (line 716-720): PyLong_From...
X Description: Compiler Pipeline (codegen + compile + symtable + flowgraph + assemble) | 6 FIX codegen.c (6,632 lines) — 4 FIX NULL deref + ref leak in codegen_setup_annotations_scope (line 716-720): PyLong_From...
Opengraph URL: https://github.com/python/cpython/pull/146443
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cb6defec-5e14-472a-2209-f7d9ff4e38b7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BD4A:3DAB37:43E9C9F:5E676FE:6A50CC6F |
| html-safe-nonce | faf5e49fde08784c3ccb70ea981d82067ce7f1278d4438f2ae44dc57ceb175c6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDRBOjNEQUIzNzo0M0U5QzlGOjVFNjc2RkU6NkE1MENDNkYiLCJ2aXNpdG9yX2lkIjoiMjQ4MzYzODI1ODg2NjYzNzkzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fde70f26ce0561ad91be406ea240f1b62f0b4ee75bbb849da9da4e7a7123d32b |
| hovercard-subject-tag | pull_request:3448829302 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/146443/files |
| twitter:image | https://avatars.githubusercontent.com/u/43610414?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/43610414?s=400&v=4 |
| og:image:alt | Compiler Pipeline (codegen + compile + symtable + flowgraph + assemble) | 6 FIX codegen.c (6,632 lines) — 4 FIX NULL deref + ref leak in codegen_setup_annotations_scope (line 716-720): PyLong_From... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 08e79d53fc070870d5b168356afebb1e286a2ffe |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width