deps: v8: fix potential segfault in profiler · nodejs/node@f22132e

Original file line numberDiff line numberDiff line change

@@ -146,8 +146,11 @@ class SamplingAllocationObserver : public AllocationObserver {

146146

void Step(int bytes_allocated, Address soon_object, size_t size) override {

147147

USE(heap_);

148148

DCHECK(heap_->gc_state() == Heap::NOT_IN_GC);

149-

DCHECK(soon_object);

150-

profiler_->SampleObject(soon_object, size);

149+

if (soon_object) {

150+

// TODO(ofrobots): it would be better to sample the next object rather

151+

// than skipping this sample epoch if soon_object happens to be null.

152+

profiler_->SampleObject(soon_object, size);

153+

}

151154

}

152155
153156

intptr_t GetNextStepSize() override { return GetNextSampleInterval(rate_); }