summaryrefslogtreecommitdiff
path: root/libunwindstack/tests/MemoryFileTest.cpp
diff options
context:
space:
mode:
authorHans Boehm <hboehm@google.com>2019-03-04 15:22:10 -0800
committerHans Boehm <hboehm@google.com>2019-03-09 21:41:37 -0800
commit029b12ebde0b5a13b4b1252dc20b2ecc8194d5b7 (patch)
tree09e950cd16c2056d2ca4d36aee57de3374eaf6b1 /libunwindstack/tests/MemoryFileTest.cpp
parent949a561cfaf96840101901c6c9448dd3e859a4bd (diff)
Fix wp and sp comparison bugs
Make clear() actually clear wp m_refs, so that nulls compare equal. Make equality consistent with < and >, ensuring that a weak pointer cannot be both equal to and greater than another. Don't rely on the built-in < and > operators to correctly order different objects. The standard does not guarantee that, and there is a risk of compiler relying on that lack of guarantee. Remove unnecessary comparison overloads, especially those comparing a wp<> to an sp<>. Change the remaining wp<> to sp<> comparisons to check for equivalence of the mRefs pointer instead of the object address, thus eliminating the dubious equal comparison result for a dead wp<> and an sp<> that happen to point to the same object address. Add comparison tests. Test: Treehugger, boot AOSP, atest RefBase Bug: 126922090 Change-Id: I15911150e0fc85ace2c4b77d337826e12793c690
Diffstat (limited to 'libunwindstack/tests/MemoryFileTest.cpp')
0 files changed, 0 insertions, 0 deletions