-
Daniel Cheng authored
If a WeakPtr references an already-destroyed object, operator-> and operator* end up simply dereferencing nullptr. However, dereferencing nullptr is undefined behavior and can be optimized in surprising ways by compilers. To prevent this from happening, add a defence of last resort and CHECK that the WeakPtr is still valid. Bug: 817982 Change-Id: Ib3a025c18fbd9d5db88770fced2063135086847b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463857 Commit-Queue: Daniel Cheng <dcheng@chromium.org> Reviewed-by:
Wez <wez@chromium.org> Reviewed-by:
Jan Wilken Dörrie <jdoerrie@chromium.org> Cr-Commit-Position: refs/heads/master@{#816701}
0b308a0e