]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-134411: assert `PyLong_FromLong(x) != NULL` when `x` is known to be small...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 21 Jul 2025 09:21:30 +0000 (11:21 +0200)
committerGitHub <noreply@github.com>
Mon, 21 Jul 2025 09:21:30 +0000 (09:21 +0000)
commitf2f30c494782509f39b98a26f08369032f498723
treece6a7f272137f5a96805289138ef7c8b5a1e84cb
parent3ee46ccb6a11015cd864f4032d5f30774fb859e1
[3.13] gh-134411: assert `PyLong_FromLong(x) != NULL` when `x` is known to be small (GH-134415) (#136911)

gh-134411: assert `PyLong_FromLong(x) != NULL` when `x` is known to be small (GH-134415)

Since `PyLong_From Long(PY_MONITORING_DEBUGGER_ID)` falls to `small_int` case and can't return `NULL`. Added `assert`s for extra confidence.
https://github.com/python/cpython/issues/134411#issuecomment-2897653868
(cherry picked from commit cf19b6435d02dd7be11b84a44f4a8a9f1a935b15)

Co-authored-by: Sergey Muraviov <smurav@mail.ru>
Python/instrumentation.c