commit | 0b308a0e37b9d14a335c3b487511b7117c98d74b | [log] [tgz] |
---|---|---|
author | Daniel Cheng <dcheng@chromium.org> | Tue Oct 13 19:17:03 2020 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Oct 13 19:17:03 2020 |
tree | 207f0d47010f0c58bc86dd76a855538d715586fc | |
parent | ff8d40ea4ea107eb6d01301deb8afe0c9dd47226 [diff] |
Prevent UB if a WeakPtr to an already-destroyed object is dereferenced. 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}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.