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 |
||
---|---|---|
.. | ||
cfastmanifest | ||
cstore | ||
ctreemanifest | ||
indexes | ||
phabricator | ||
pyrevisionstore | ||
pywatchman | ||
watchmanclient | ||
__init__.py | ||
cfastmanifest.c | ||
linelog.pyx | ||
litemmap.pyx | ||
mysqlutil.py | ||
README.md | ||
traceprofimpl.cpp |
extlib
Code that extensions depend on, but aren't themselves extensions, should go here. Both native (C/C++/Cython/Rust) and Python code is allowed. Code that depends on Python is also allowed.
In theory, this code should slowly disappear as extension code gets folded into
mainline Mercurial. (The native bits should go into lib/
or mercurial/cext
),
the Python code into mercurial/
itself.)
See also lib/README.md
, mercurial/cext/README.md
.