gh-132983: _zstd: use Py_UNREACHABLE in _zstd_load_impl#137320
Conversation
emmatyping
left a comment
There was a problem hiding this comment.
Thank you!
Sorry, something went wrong.
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM as well.
@emmatyping Would you like to use your new green button?
Sorry, something went wrong.
|
Hm, how are you envisioning that? The whole point of |
Sorry, something went wrong.
|
I'm not a fan of needing logic like this, and it would be nice to exhaustively test that we never hit it, but I haven't had a good idea, no. A |
Sorry, something went wrong.
|
Anyway, the compression path already uses A |
Sorry, something went wrong.
57eab1b
into
python:main
Aug 4, 2025
|
Thanks @Rogdham for the PR, and @AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
…honGH-137320) (cherry picked from commit 57eab1b) Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
…`` (pythonGH-137320) (python#137360) Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
There are 2 functions called
_zstd_load_impl: one for compression and one for decompression.In these functions, the
typevariable is supposed to represent the dict type. Due to the way the function is called, the dict type is always one ofDICT_TYPE_DIGESTED/DICT_TYPE_UNDIGESTED/DICT_TYPE_PREFIX. However, the implementations differs in the unreachable case:Py_UNREACHABLESystemErrorexceptionThis PR harmonizes the two implementations by using
Py_UNREACHABLE.