Fixes: prevent compiler reporting UB, hazptr_array move operator, empty array test
authorMaged Michael <magedmichael@fb.com>
Tue, 3 Oct 2017 14:56:57 +0000 (07:56 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 3 Oct 2017 15:09:32 +0000 (08:09 -0700)
commit36b8f9c6be3f6f2a8f6bb111627b277ee3707b03
tree70c9dfd9ec5dd3972241f56b1b520badee238128
parent6f3b7616f3402355441c62ca60a36159435aa818
Fixes: prevent compiler reporting UB, hazptr_array move operator, empty array test
Summary:
Three fixes:
(1) The compiler reports UB in line 432 for the case M > HAZPTR_TC_SIZE even though it is executed only if M <= HAZPTR_TC_SIZE. Added a condition M <= HAZPTR_TC_SIZE to help the compiler determine that line 432 is not executed in that case.
(2) Added missing management of empty state in hazptr_array move operator
(3) Added nullptr argument to empty hazptr_array in Array test

Reviewed By: djwatson

Differential Revision: D5951283

fbshipit-source-id: cb8e61421ab06c7733f67bf2d2274d3311260ac4
folly/experimental/hazptr/hazptr-impl.h
folly/experimental/hazptr/test/HazptrTest.cpp