summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/profiler.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/profiler.cc b/src/profiler.cc
index b862ae6..f4f5990 100644
--- a/src/profiler.cc
+++ b/src/profiler.cc
@@ -360,7 +360,7 @@ void CpuProfiler::prof_handler(int sig, siginfo_t*, void* signal_ucontext,
3, signal_ucontext);
void **used_stack;
- if (stack[1] == stack[0]) {
+ if (depth > 0 && stack[1] == stack[0]) {
// in case of non-frame-pointer-based unwinding we will get
// duplicate of PC in stack[1], which we don't want
used_stack = stack + 1;