OSDN Git Service

Fix potential null pointer dereference.
authorNicolas Capens <capn@google.com>
Tue, 25 Apr 2017 20:41:00 +0000 (16:41 -0400)
committerNicolas Capens <nicolascapens@google.com>
Tue, 25 Apr 2017 21:01:16 +0000 (21:01 +0000)
commit6c629dc303ddbb76edc70832073bc22657783079
tree8568ddd5d634fa91ea9f9078b14b1b07acccce02
parent47b6ba6db7c8b8dd36ac54dbd19ae7b4a5b77424
Fix potential null pointer dereference.

When the compiler does not perform return value optimization, the
LockPtr<> destructor of the temporary object is called after the move
constructor has set the Lock to null, thus causing a null pointer
dereference in the destructor. This can be replicated using the
-fno-elide-constructors build flag.

Change-Id: Ie00c3f93364fdf78ea1993469b9a606b3c87ebdc
Reviewed-on: https://chromium-review.googlesource.com/486985
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
src/IceDefs.h