You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... and malloc(0) is implementation-defined. This works fine on my machine, but may throw an exception on other machines.
This happens via PyDataMem_NEW, so we at least have a point we can intercept this. We should probably do one of:
Ensure that PyDataMem_NEW(0) is never called (and perhaps make it fail on all platforms to make this detectable)
Special-case PyDataMem_NEW(0) to mean PyDataMem_NEW(1), so that it the allocation always succeeds
Do the above conditionally on feature-detection of malloc(0) == NULL performed in configtest, to avoid the cost of the conditional on platforms with the version of malloc which is convenient for us.
There are probably a few places where there is a similar problem with PyDataMem_RENEW(ptr, 0), except that does the wrong thing on all platforms
The text was updated successfully, but these errors were encountered:
All the code paths in the PR show 100% coverage, implying they are tested, which is why I did not require additional tests before merging. Although one more test could not hurt.
... and
malloc(0)
is implementation-defined. This works fine on my machine, but may throw an exception on other machines.This happens via
PyDataMem_NEW
, so we at least have a point we can intercept this. We should probably do one of:PyDataMem_NEW(0)
is never called (and perhaps make it fail on all platforms to make this detectable)PyDataMem_NEW(0)
to meanPyDataMem_NEW(1)
, so that it the allocation always succeedsmalloc(0) == NULL
performed inconfigtest
, to avoid the cost of the conditional on platforms with the version ofmalloc
which is convenient for us.There are probably a few places where there is a similar problem with
PyDataMem_RENEW(ptr, 0)
, except that does the wrong thing on all platformsThe text was updated successfully, but these errors were encountered: