mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
49b000422f
Summary: Fix subtreeiter_create() to avoid calling the `SubtreeIterator` destructor on an object that it never constructed. If an error is thrown constructing the `cmpNodes` vector or calling the `SubtreeIterator` constructor, then the `SubtreeIterator` destructor should not be called. However, the `subtreeiter_create()` previously used `Py_DECREF` to clean up the object, which always invoked `subtreeiter_dealloc()` and called the `SubtreeIterator` destructor. It looks like a lot of the other python object types declared in this file have similar problems, and may incorrectly invoke C++ destructors on objects that were never constructed if something goes wrong during object initialization. I have not fixed the other types yet as part of this diff. The initialization logic for each type looks somewhat different, so they will each need different fixes rather than this simple change of just calling `PyObject_Del()` rather than `Py_DECREF()`. Reviewed By: quark-zju Differential Revision: D8963858 fbshipit-source-id: d610cac16133a7ff2350c17b13b5ebc7b7becc29 |
||
---|---|---|
.. | ||
datapackstore.cpp | ||
datapackstore.h | ||
datastore.h | ||
deltachain.cpp | ||
deltachain.h | ||
key.h | ||
match.h | ||
py-cdatapack.h | ||
py-cstore.cpp | ||
py-datapackstore.h | ||
py-structs.h | ||
py-treemanifest.h | ||
pythondatastore.cpp | ||
pythondatastore.h | ||
pythonkeyiterator.h | ||
pythonutil.cpp | ||
pythonutil.h | ||
store.h | ||
uniondatapackstore.cpp | ||
uniondatapackstore.h | ||
util.h |