Changeset 34092 in webkit for trunk/JavaScriptCore
- Timestamp:
- May 23, 2008, 4:07:19 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r34091 r34092 1 2008-05-23 Kevin McCullough <[email protected]> 2 3 Reviewed by Sam. 4 5 <rdar://problem/5960012> JSProfiler: Stack overflow if recursion is 6 too deep. 7 -Use a simple depth limit to restrict too deep of recursion. 8 9 * profiler/Profile.cpp: 10 (KJS::Profile::willExecute): 11 (KJS::Profile::didExecute): 12 * profiler/Profile.h: 13 1 14 2008-05-23 Geoffrey Garen <[email protected]> 2 15 -
trunk/JavaScriptCore/profiler/Profile.cpp
r34090 r34092 36 36 namespace KJS { 37 37 38 const unsigned DEPTH_LIMIT = 1000; 39 38 40 Profile::Profile(const UString& title, ExecState* originatingGlobalExec, unsigned pageGroupIdentifier) 39 41 : m_title(title) 40 42 , m_originatingGlobalExec(originatingGlobalExec) 41 43 , m_pageGroupIdentifier(pageGroupIdentifier) 44 , m_depth(0) 42 45 { 43 46 // FIXME: When multi-threading is supported this will be a vector and calls … … 52 55 m_originatingGlobalExec = 0; 53 56 m_headNode->stopProfiling(); 57 m_depth = 0; 54 58 } 55 59 56 60 void Profile::willExecute(const CallIdentifier& callIdentifier) 57 61 { 62 if (++m_depth >= DEPTH_LIMIT) 63 return; 64 58 65 ASSERT(m_currentNode); 59 66 m_currentNode = m_currentNode->willExecute(callIdentifier); … … 77 84 78 85 m_currentNode = m_currentNode->didExecute(); 86 --m_depth; 79 87 } 80 88 -
trunk/JavaScriptCore/profiler/Profile.h
r34051 r34092 79 79 RefPtr<ProfileNode> m_headNode; 80 80 RefPtr<ProfileNode> m_currentNode; 81 82 unsigned m_depth; 81 83 }; 82 84
Note:
See TracChangeset
for help on using the changeset viewer.