Commit 8531eb86 authored by kaiwang@chromium.org's avatar kaiwang@chromium.org Committed by Commit Bot

Force abort to a volatile pointer.

Write to NULL will trigger a Clang compile warning and the compiler may
optimize and turn it into a non-op.
int* -> volatile int* to fix this.

Original BUG=127724

BUG=724399,b:70905156

Review URL: https://chromiumcodereview.appspot.com/10392109

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137251 0039d316-1c4b-4281-b951-d872f2087c98
(cherry picked from commit 59ba0417)
Signed-off-by: default avatarGabriel Marin <gmx@chromium.org>

Change-Id: Ida066f00891c47ee5c42fd272ad976cb3f45572e
Reviewed-on: https://chromium-review.googlesource.com/1130777
Commit-Queue: Gabriel Marin <gmx@chromium.org>
Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578422}
parent 897c358b
......@@ -25,7 +25,7 @@ inline void Abort() {
namespace tcmalloc {
inline void Abort() {
// Make a segmentation fault to force abort.
*reinterpret_cast<int*>(NULL) = 0x2001;
*reinterpret_cast<volatile int*>(NULL) = 0x2001;
}
} // namespace tcmalloc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment