If I understand this numpy code correctly the memory location passed via PyArray_Dims is mutated if a wildcard dimension i.e. -1 is present.
This means that reshape and resize calls via ToNpyDims results in UB in all invocations with a -1 since the ptr is casted from a shared slice reference.
If I understand this numpy code correctly the memory location passed via
PyArray_Dims
is mutated if a wildcard dimension i.e. -1 is present.This means that reshape and resize calls via
ToNpyDims
results in UB in all invocations with a -1 since the ptr is casted from a shared slice reference.