pylint-dev / astroid

A common base representation of python source code for pylint and other projects
https://pylint.readthedocs.io/projects/astroid/en/latest/
GNU Lesser General Public License v2.1
532 stars 276 forks source link

Fix crashes with large positive and negative list multipliers #2596

Closed correctmost closed 1 month ago

correctmost commented 1 month ago

Type of Changes

Type
:bug: Bug fix

Description

2523 is causing coverage builds to fail on OSS-Fuzz (https://github.com/pylint-dev/astroid/issues/2511#issuecomment-2311387720)

Closes #2521 Closes #2523

References

Previous fix in this area: https://github.com/pylint-dev/astroid/pull/2228

Python docs on list multiplication:

Values of n less than 0 are treated as 0 (which yields an empty sequence of the same type as s). -- https://docs.python.org/3.14/library/stdtypes.html#sequence-types-list-tuple-range

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.19%. Comparing base (ba7df4a) to head (de82852).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/pylint-dev/astroid/pull/2596/graphs/tree.svg?width=650&height=150&src=pr&token=Buxy4WptLb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pylint-dev)](https://app.codecov.io/gh/pylint-dev/astroid/pull/2596?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pylint-dev) ```diff @@ Coverage Diff @@ ## main #2596 +/- ## ======================================= Coverage 93.19% 93.19% ======================================= Files 93 93 Lines 11052 11055 +3 ======================================= + Hits 10300 10303 +3 Misses 752 752 ``` | [Flag](https://app.codecov.io/gh/pylint-dev/astroid/pull/2596/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pylint-dev) | Coverage Δ | | |---|---|---| | [linux](https://app.codecov.io/gh/pylint-dev/astroid/pull/2596/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pylint-dev) | `93.08% <100.00%> (+<0.01%)` | :arrow_up: | | [pypy](https://app.codecov.io/gh/pylint-dev/astroid/pull/2596/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pylint-dev) | `93.19% <100.00%> (+<0.01%)` | :arrow_up: | | [windows](https://app.codecov.io/gh/pylint-dev/astroid/pull/2596/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pylint-dev) | `93.17% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pylint-dev#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/pylint-dev/astroid/pull/2596?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pylint-dev) | Coverage Δ | | |---|---|---| | [astroid/protocols.py](https://app.codecov.io/gh/pylint-dev/astroid/pull/2596?src=pr&el=tree&filepath=astroid%2Fprotocols.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pylint-dev#diff-YXN0cm9pZC9wcm90b2NvbHMucHk=) | `89.85% <100.00%> (+0.07%)` | :arrow_up: |