libchromiumcontent/patches/v8/022-fix_potential_segfault....

19 строки
845 B
Diff

diff --git a/src/profiler/sampling-heap-profiler.h b/src/profiler/sampling-heap-profiler.h
index 07840244ce..3a347dd54e 100644
--- a/src/profiler/sampling-heap-profiler.h
+++ b/src/profiler/sampling-heap-profiler.h
@@ -172,8 +172,11 @@ class SamplingAllocationObserver : public AllocationObserver {
void Step(int bytes_allocated, Address soon_object, size_t size) override {
USE(heap_);
DCHECK(heap_->gc_state() == Heap::NOT_IN_GC);
- DCHECK(soon_object);
- profiler_->SampleObject(soon_object, size);
+ if (soon_object) {
+ // TODO(ofrobots): it would be better to sample the next object rather
+ // than skipping this sample epoch if soon_object happens to be null.
+ profiler_->SampleObject(soon_object, size);
+ }
}
intptr_t GetNextStepSize() override { return GetNextSampleInterval(rate_); }