Title: Fix overflow handling for inplace sequence repetition by seungje0612 · Pull Request #8270 · RustPython/RustPython · GitHub
Open Graph Title: Fix overflow handling for inplace sequence repetition by seungje0612 · Pull Request #8270 · RustPython/RustPython
X Title: Fix overflow handling for inplace sequence repetition by seungje0612 · Pull Request #8270 · RustPython/RustPython
Description: Closes #xxxx This PR follows our AI policy Summary Fix a crash when repeating a list in place with an excessively large repeat count. Previously, the resulting allocation can exceed the maximum supported memory size, causing list.imul to attempt an invalid allocation. This change adds the same memory-size check used by regular sequence multiplication. The operation now raises MemoryError before mutating the original sequence. The corresponding test_list_resize_overflow test is no longer skipped. Summary by CodeRabbit Bug Fixes Added an extra memory overflow check for in-place sequence multiplication. Operations that would exceed the allowed memory limit now fail gracefully with an error instead of risking a crash. Tests Enabled the list resize overflow regression test so it runs as part of the standard test suite.
Open Graph Description: Closes #xxxx This PR follows our AI policy Summary Fix a crash when repeating a list in place with an excessively large repeat count. Previously, the resulting allocation can exceed the maximum ...
X Description: Closes #xxxx This PR follows our AI policy Summary Fix a crash when repeating a list in place with an excessively large repeat count. Previously, the resulting allocation can exceed the maximum ...
Opengraph URL: https://github.com/RustPython/RustPython/pull/8270
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b790ceb8-2faa-ed6e-773a-557d0f28231e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EA62:1DBC44:C301FF:1182144:6A58D2CD |
| html-safe-nonce | 584846b898fd109d57ba19470aade60352b65bcef75b64ac985bfa14ffbe81b6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTYyOjFEQkM0NDpDMzAxRkY6MTE4MjE0NDo2QTU4RDJDRCIsInZpc2l0b3JfaWQiOiI4NjExMDU4NTY1Nzk1ODYxMTk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ccaa6b1956c28cbb36383ae0b4237a375d69ab24b0775e3b1458851c331942f0 |
| hovercard-subject-tag | pull_request:4044520627 |
| 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/RustPython/RustPython/pull/8270/files |
| twitter:image | https://avatars.githubusercontent.com/u/88067455?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/88067455?s=400&v=4 |
| og:image:alt | Closes #xxxx This PR follows our AI policy Summary Fix a crash when repeating a list in place with an excessively large repeat count. Previously, the resulting allocation can exceed the maximum ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width