From d1d973be1214985221526bcaeb4d3fe7a02fd2f8 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 19 Jun 2019 18:41:37 -0700 Subject: [PATCH] Fix potential race condition. Found when I noticed that the unit tests segfaulted every once in a while. Test: Ran all unit tests 1000 times. The crash usually happens before 100 runs. Change-Id: I1c8d2e3637400dc80f273f3677f4c94b0dbeac9d --- libunwindstack/MapInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libunwindstack/MapInfo.cpp b/libunwindstack/MapInfo.cpp index 1c0f1e611..5b30a4d7b 100644 --- a/libunwindstack/MapInfo.cpp +++ b/libunwindstack/MapInfo.cpp @@ -300,7 +300,7 @@ MapInfo::~MapInfo() { std::string MapInfo::GetBuildID() { uintptr_t id = build_id.load(); - if (build_id != 0) { + if (id != 0) { return *reinterpret_cast(id); }