Index: src/frames.cc |
diff --git a/src/frames.cc b/src/frames.cc |
index 88c723d6932d2eabae3a1bfd86c1604c81fa9d15..a9bbbede388f9197193412287781fa45b918c9e6 100644 |
--- a/src/frames.cc |
+++ b/src/frames.cc |
@@ -86,7 +86,6 @@ StackFrameIterator::StackFrameIterator(bool use_top, Address fp, Address sp) |
if (use_top || fp != NULL) { |
Reset(); |
} |
- JavaScriptFrame_.DisableHeapAccess(); |
} |
#undef INITIALIZE_SINGLETON |
@@ -232,7 +231,11 @@ bool SafeStackFrameIterator::CanIterateHandles(StackFrame* frame, |
bool SafeStackFrameIterator::IsValidFrame(StackFrame* frame) const { |
- return IsValidStackAddress(frame->sp()) && IsValidStackAddress(frame->fp()); |
+ return IsValidStackAddress(frame->sp()) && IsValidStackAddress(frame->fp()) && |
+ // JavaScriptFrame uses function shared info to advance, hence it must |
+ // point to a valid function object. |
+ (!frame->is_java_script() || |
+ reinterpret_cast<JavaScriptFrame*>(frame)->is_at_function()); |
} |
@@ -278,7 +281,7 @@ void SafeStackFrameIterator::Reset() { |
SafeStackTraceFrameIterator::SafeStackTraceFrameIterator( |
Address fp, Address sp, Address low_bound, Address high_bound) : |
SafeJavaScriptFrameIterator(fp, sp, low_bound, high_bound) { |
- if (!done() && !frame()->is_java_script()) Advance(); |
+ if (!done() && !frame()->is_at_function()) Advance(); |
} |
@@ -286,7 +289,7 @@ void SafeStackTraceFrameIterator::Advance() { |
while (true) { |
SafeJavaScriptFrameIterator::Advance(); |
if (done()) return; |
- if (frame()->is_java_script()) return; |
+ if (frame()->is_at_function()) return; |
} |
} |
#endif |