##// END OF EJS Templates
parse_index2: fix crash on bad argument type (issue4110)...
parse_index2: fix crash on bad argument type (issue4110) Passing a non-string to parsers.parse_index2() causes Mercurial to crash instead of raising a TypeError (found on Mac OS X 10.8.5, Python 2.7.6): import mercurial.parsers as parsers parsers.parse_index2(0, 0) Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 parsers.so 0x000000010e071c59 _index_clearcaches + 73 (parsers.c:644) 1 parsers.so 0x000000010e06f2d5 index_dealloc + 21 (parsers.c:1767) 2 parsers.so 0x000000010e074e3b parse_index2 + 347 (parsers.c:1891) 3 org.python.python 0x000000010dda8b17 PyEval_EvalFrameEx + 9911 This happens because when arguments of the wrong type are passed to parsers.parse_index2(), indexType's initialization function index_init() in parsers.c leaves the indexObject instance in a state that indexType's destructor function index_dealloc() cannot handle. This patch moves enough of the indexObject initialization code inside index_init() from after the argument validation code to before it. This way, when bad arguments are passed to index_init(), the destructor doesn't crash and the existing code to raise a TypeError works. This patch also adds a test to check that a TypeError is raised.
Chris Jerdonek -
r20109:e57c532c stable
Show More
Name Size Modified Last Commit Author
contrib
doc
hgext
i18n
mercurial
tests
.hgignore Loading ...
.hgsigs Loading ...
.hgtags Loading ...
CONTRIBUTORS Loading ...
COPYING Loading ...
Makefile Loading ...
README Loading ...
hg Loading ...
hgeditor Loading ...
hgweb.cgi Loading ...
setup.py Loading ...

Mercurial
=========

Mercurial is a fast, easy to use, distributed revision control tool
for software developers.

Basic install:

$ make # see install targets
$ make install # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg # see help

Running without installing:

$ make local # build for inplace usage
$ ./hg --version # should show the latest version

See http://mercurial.selenic.com/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.