Fix handling of a self-initialised PIMPL object
commit993fec0b6e86a4ec0e7a653c932b75fdc09fb2de
authorOlly Betts <olly@survex.com>
Mon, 9 May 2016 03:24:23 +0000 (9 15:24 +1200)
committerOlly Betts <olly@survex.com>
Mon, 9 May 2016 03:24:23 +0000 (9 15:24 +1200)
tree59d49e08036c22543ba9b41db44c2edffd8af0fa
parent6fd6a2ea04f5ad09a584f112f85a6012f2f4d3f1
Fix handling of a self-initialised PIMPL object

Previously the uninitialised pointer was copied, resulting in undefined
behaviour.

This isn't something you'd see in normal code, but it's a cheap check
which can probably be optimised away by the compiler.
xapian-core/include/xapian/intrusive_ptr.h
xapian-core/tests/api_query.cc