8000 BUG: ndarray.base is not yet set in __array_finalize__, causing use-after-free · Issue #11237 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
8000
BUG: ndarray.base is not yet set in __array_finalize__, causing use-after-free #11237
Closed
@eric-wieser

Description

@eric-wieser

ndarray.base seems like it would be useful state for implementers of __array_finalize__:

In [1]: class bad(np.ndarray):
   ...:     def __array_finalize__(self, x):
   ...:         print("Base is", self.base)
   ...:

In [2]: x = np.array(1).view(bad)
Base is None

In [3]: x.base
Out[3]: array(1)

Metadata

Metadata

Assignees

No one 3AB7 assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0