summaryrefslogtreecommitdiff
path: root/debuggerd/handler/debuggerd_handler.cpp
diff options
context:
space:
mode:
authorHans Boehm <hboehm@google.com>2019-03-13 17:34:46 +0000
committerHans Boehm <hboehm@google.com>2019-03-13 13:26:35 -0700
commit6e75ad6e137e8cbae0a70b1fc2955d3f5ca51447 (patch)
treeef83881e0fe45c320d4b9a54b783fbbeca5f2dcd /debuggerd/handler/debuggerd_handler.cpp
parente61e8c6b628e4ce0e4c5e5b579af0eead322c247 (diff)
Revert "Revert "Fix wp and sp comparison bugs""
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. This reverts commit a2a2ad805775ea88f25388677aa37e0492a492c4. The original code, and my original CL, both failed to initialize m_refs in various wp<> constructors. This now became more important, since comparisons now rely more on m_refs. However I believe it was always a bug, since some comparisons always relied on m_refs. Test: Treehugger, boot AOSP, atest RefBase Bug: 126922090 This reverts commit a2a2ad805775ea88f25388677aa37e0492a492c4. Reason for revert: Reapply after constructor fixes. Change-Id: I2c8917416a2306e36d2b6bb7b397f653020e5688
Diffstat (limited to 'debuggerd/handler/debuggerd_handler.cpp')
0 files changed, 0 insertions, 0 deletions