ART: Expect a null self in SetEntrypointsInstrumented
Follow-up to commit 157c77eb9a5d6a7fe6ebcc29afa7f1913a877c87.
Bug: 31684277
Test: m ART_TEST_GC_STRESS=true test-art-host
Change-Id: I9de848ea6a9484798b75a594f3e390ef27394743
diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc
index bed489f..36e8608 100644
--- a/runtime/instrumentation.cc
+++ b/runtime/instrumentation.cc
@@ -650,7 +650,11 @@
// Note: ResetQuickAllocEntryPoints only works when the runtime is started. Manually run the
// update for just this thread.
- ResetQuickAllocEntryPointsForThread(self, nullptr);
+ // Note: self may be null. One of those paths is setting instrumentation in the Heap
+ // constructor for gcstress mode.
+ if (self != nullptr) {
+ ResetQuickAllocEntryPointsForThread(self, nullptr);
+ }
alloc_entrypoints_instrumented_ = instrumented;
}