Chromium Code Reviews| 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..b2bba7010bfde256aa3990d2753272f5c81c9a97 100644 |
| --- a/src/profiler/sampling-heap-profiler.cc |
| +++ b/src/profiler/sampling-heap-profiler.cc |
| @@ -204,15 +204,17 @@ v8::AllocationProfile::Node* SamplingHeapProfiler::TranslateAllocationNode( |
| // 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_]; |
| - if (script->name()->IsName()) { |
| - Name* name = Name::cast(script->name()); |
| - script_name = ToApiHandle<v8::String>( |
| - isolate_->factory()->InternalizeUtf8String(names_->GetName(name))); |
| + if (script) { |
| + if (script->name()->IsName()) { |
| + Name* name = Name::cast(script->name()); |
|
Michael Achenbach
2016/03/24 09:18:25
Experimental code-coverage reports this block as n
|
| + script_name = ToApiHandle<v8::String>( |
| + isolate_->factory()->InternalizeUtf8String(names_->GetName(name))); |
| + } |
| + Handle<Script> script_handle(script); |
| + line = 1 + Script::GetLineNumber(script_handle, node->script_position_); |
| + column = |
| + 1 + Script::GetColumnNumber(script_handle, node->script_position_); |
| } |
| - Handle<Script> script_handle(script); |
| - |
| - line = 1 + Script::GetLineNumber(script_handle, node->script_position_); |
| - column = 1 + Script::GetColumnNumber(script_handle, node->script_position_); |
| for (auto alloc : node->allocations_) { |
| allocations.push_back(ScaleSample(alloc.first, alloc.second)); |
| } |