diff options
author | Christopher Ferris <cferris@google.com> | 2014-01-28 22:16:14 -0800 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2014-01-28 22:21:14 -0800 |
commit | 2b4ae52a56e175cc64baaa6c70412d06411d7af0 (patch) | |
tree | edcb337dc4c7b125ccf9ec5c9f2f19cbf6089f8e | |
parent | 6e34793b9cf11237670a5daa320cd784f7442532 (diff) | |
download | system_core-2b4ae52a56e175cc64baaa6c70412d06411d7af0.zip system_core-2b4ae52a56e175cc64baaa6c70412d06411d7af0.tar.gz system_core-2b4ae52a56e175cc64baaa6c70412d06411d7af0.tar.bz2 |
Fix global pointing to local variable.
Change-Id: I933cbb680ca6310c13634f09a9827077c8dbd568
-rw-r--r-- | libbacktrace/UnwindMap.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libbacktrace/UnwindMap.cpp b/libbacktrace/UnwindMap.cpp index 9c8193b..03bb192 100644 --- a/libbacktrace/UnwindMap.cpp +++ b/libbacktrace/UnwindMap.cpp @@ -33,7 +33,7 @@ // of maps using the same map cursor. //------------------------------------------------------------------------- static pthread_mutex_t g_map_mutex = PTHREAD_MUTEX_INITIALIZER; -static unw_map_cursor_t* g_map_cursor = NULL; +static unw_map_cursor_t g_map_cursor; static int g_map_references = 0; UnwindMap::UnwindMap(pid_t pid) : BacktraceMap(pid) { @@ -64,11 +64,11 @@ bool UnwindMap::Build() { // Set the local address space to this cursor map. unw_map_set(unw_local_addr_space, &map_cursor_); g_map_references = 1; - g_map_cursor = &map_cursor_; + g_map_cursor = map_cursor_; } } else { g_map_references++; - map_cursor_ = *g_map_cursor; + map_cursor_ = g_map_cursor; } pthread_mutex_unlock(&g_map_mutex); } else { |