summaryrefslogtreecommitdiffstats
path: root/libbacktrace
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2018-01-22 17:37:59 -0800
committerChristopher Ferris <cferris@google.com>2018-01-22 17:37:59 -0800
commit2486d5a10d01d9427f86f02a33ddb9a49ce671f5 (patch)
treec55a4969ec0e4a0e68ab97d2bb2d24e18c85dca5 /libbacktrace
parent0ba2c9f4a242570b416a2814818787a4d29d3f19 (diff)
downloadsystem_core-2486d5a10d01d9427f86f02a33ddb9a49ce671f5.tar.gz
system_core-2486d5a10d01d9427f86f02a33ddb9a49ce671f5.tar.bz2
system_core-2486d5a10d01d9427f86f02a33ddb9a49ce671f5.zip
Fix null ptr dereference if jit debug not enabled.
Test: No crash when a jit debug object is not instantiated. Change-Id: Ic4350a10258459ead7c5679ceb84372f1084f0ad
Diffstat (limited to 'libbacktrace')
-rw-r--r--libbacktrace/UnwindStack.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbacktrace/UnwindStack.cpp b/libbacktrace/UnwindStack.cpp
index bbfbddaa8..a748d1b4f 100644
--- a/libbacktrace/UnwindStack.cpp
+++ b/libbacktrace/UnwindStack.cpp
@@ -50,7 +50,9 @@ bool Backtrace::Unwind(unwindstack::Regs* regs, BacktraceMap* back_map,
auto process_memory = stack_map->process_memory();
unwindstack::Unwinder unwinder(MAX_BACKTRACE_FRAMES + num_ignore_frames, stack_map->stack_maps(),
regs, stack_map->process_memory());
- unwinder.SetJitDebug(stack_map->GetJitDebug(), regs->Arch());
+ if (stack_map->GetJitDebug() != nullptr) {
+ unwinder.SetJitDebug(stack_map->GetJitDebug(), regs->Arch());
+ }
unwinder.Unwind(skip_names, &stack_map->GetSuffixesToIgnore());
if (num_ignore_frames >= unwinder.NumFrames()) {