Index: src/profiler/sampling-heap-profiler.cc |
diff --git a/src/profiler/sampling-heap-profiler.cc b/src/profiler/sampling-heap-profiler.cc |
index b38643cf1a3a67e1516146219fd4ef86a9c12ae4..77a2ed1fe3df6108bab841ac33d3a6fdecb792d7 100644 |
--- a/src/profiler/sampling-heap-profiler.cc |
+++ b/src/profiler/sampling-heap-profiler.cc |
@@ -200,7 +200,8 @@ v8::AllocationProfile::Node* SamplingHeapProfiler::TranslateAllocationNode( |
int column = v8::AllocationProfile::kNoColumnNumberInfo; |
std::vector<v8::AllocationProfile::Allocation> allocations; |
allocations.reserve(node->allocations_.size()); |
- if (node->script_id_ != v8::UnboundScript::kNoScriptId) { |
+ if (node->script_id_ != v8::UnboundScript::kNoScriptId && |
+ scripts.count(node->script_id_)) { |
ofrobots
2016/03/30 22:35:35
Why use map::count? map::find would be more intuit
mattloring
2016/03/30 23:55:09
Done.
|
// Cannot use std::map<T>::at because it is not available on android. |
auto non_const_scripts = const_cast<std::map<int, Script*>&>(scripts); |
Script* script = non_const_scripts[node->script_id_]; |