void CheckHeapTracer::onChild(const JS::GCCellPtr& thing) { Cell* cell = thing.asCell(); if (visited.lookup(cell)) return; if (!visited.put(cell)) { oom = true; return; } if (!IsGCThingValidAfterMovingGC(cell)) { failures++; fprintf(stderr, "Stale pointer %p\n", cell); const char* name = contextName(); for (int index = parentIndex; index != -1; index = stack[index].parentIndex) { const WorkItem& parent = stack[index]; cell = parent.thing.asCell(); fprintf(stderr, " from %s %p %s edge\n", GCTraceKindToAscii(cell->getTraceKind()), cell, name); name = parent.name; } fprintf(stderr, " from root %s\n", name); return; } WorkItem item(thing, contextName(), parentIndex); if (!stack.append(item)) oom = true; }