aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/google_breakpad/processor/stackwalker.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/google_breakpad/processor/stackwalker.h b/src/google_breakpad/processor/stackwalker.h
index 0c458d50..daa5039a 100644
--- a/src/google_breakpad/processor/stackwalker.h
+++ b/src/google_breakpad/processor/stackwalker.h
@@ -176,8 +176,12 @@ class Stackwalker {
if (!memory_->GetMemoryAtAddress(location, &ip))
break;
- if (modules_ && modules_->GetModuleForAddress(ip) &&
- InstructionAddressSeemsValid(ip)) {
+ // The return address points to the instruction after a call. If the
+ // caller was a no return function, this might point past the end of the
+ // function. Subtract one from the instruction pointer so it points into
+ // the call instruction instead.
+ if (modules_ && modules_->GetModuleForAddress(ip - 1) &&
+ InstructionAddressSeemsValid(ip - 1)) {
*ip_found = ip;
*location_found = location;
return true;