Skip to content

Always set exception on allocation failures#1044

Merged
provinzkraut merged 3 commits into
msgspec:mainfrom
sobolevn:set-exceptions-on-malloc-failures
Jun 10, 2026
Merged

Always set exception on allocation failures#1044
provinzkraut merged 3 commits into
msgspec:mainfrom
sobolevn:set-exceptions-on-malloc-failures

Conversation

@sobolevn

@sobolevn sobolevn commented Jun 7, 2026

Copy link
Copy Markdown
Member

Some places in the code were not settings exception when retuning NULL, which will crash Python.

I also refactored PyExc_NoMemory(); return NULL; to be more ideomatic return PyExc_NoMemory();

@sobolevn sobolevn force-pushed the set-exceptions-on-malloc-failures branch from 24e9c4f to d1893ae Compare June 7, 2026 12:45
@provinzkraut provinzkraut added this pull request to the merge queue Jun 10, 2026
Merged via the queue into msgspec:main with commit 76474a8 Jun 10, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants