[Mesa-dev] [Bug 86958] lp_bld_misc.cpp:503:40: error: no matching function for call to ‘llvm?=::EngineBuilder::setMCJITMemoryManager(ShaderMemoryManager*&)=?UTF-8?Q?’

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Feb 28 14:52:59 PST 2015


https://bugs.freedesktop.org/show_bug.cgi?id=86958

--- Comment #6 from Chris Vine <chris at cvine.freeserve.co.uk> ---
Emil,

OK about your first point, and thanks.

On your second, as the name suggests the whole purpose of std::unique_ptr is to
take unique ownership.  a unique_ptr will delete any object it still owns, in
its destructor.  Ownership is transferred from one unique_ptr to another by
passing the unique_ptr as an rvalue.  This will release ownership in the movant
and pass it to the movee.  You must never call delete manually on an object
owned by a unique_ptr or you will get a double delete, so this code is
definitely wrong.

Of course this begs the question of what
EngineBuilder::setMCJITMemoryManager(ShaderMemoryManager*) does in llvm < 3.6. 
If that method also tries to delete its argument when finished with, you would
get a double delete in the error case (ie where EngineBuilder::create() fails)
for earlier versions of llvm.  In other words, the delete call may be wrong in
all cases.

Do you want me to open a separate bug to say so?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150228/ed7dd017/attachment.html>


More information about the mesa-dev mailing list