diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2020-06-21 02:47:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-21 02:47:22 (GMT) |
commit | 71bb921829c33c30b2e111e18948df8c2b6731e4 (patch) | |
tree | cdcfa2d0ffed021c046d3dbc355fdeefa583b025 /Python/sysmodule.c | |
parent | d301d9473e9a9b78d6e6678e9fe5ef66d46084e1 (diff) | |
download | cpython-71bb921829c33c30b2e111e18948df8c2b6731e4.zip cpython-71bb921829c33c30b2e111e18948df8c2b6731e4.tar.gz cpython-71bb921829c33c30b2e111e18948df8c2b6731e4.tar.bz2 |
[3.9] bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar (GH-21020) (GH-21024)
`GET_INVALID_TARGET` might unexpectedly return `NULL`, which if not
caught will cause a SEGFAULT. Therefore, this commit introduces a new
inline function `RAISE_SYNTAX_ERROR_INVALID_TARGET` that always
checks for `GET_INVALID_TARGET` returning NULL and can be used in
the grammar, replacing the long C ternary operation used till now.
(cherry picked from commit 6c4e0bd974f2895d42b63d9d004587e74b286c88)
Automerge-Triggered-By: @pablogsal
Diffstat (limited to 'Python/sysmodule.c')
0 files changed, 0 insertions, 0 deletions