ART: Fix ArenaAllocator invariant check in Realloc

It is indeed possible to see end == ptr_ under sanitization in the
case that the caller Reallocs a (null, 0) allocation. This happens,
for example, in the classlinker during linking of methods (empty
interface method list).

Bug: 31098551
Test: ART_ENABLE_ADDRESS_SANITIZER=true SANITIZE_HOST=address m test-art-host
Change-Id: Ie79f27c39e07cc3793c0766fa8ea233b488dfaf0
diff --git a/runtime/base/arena_allocator.h b/runtime/base/arena_allocator.h
index ebde82d..a484c5c 100644
--- a/runtime/base/arena_allocator.h
+++ b/runtime/base/arena_allocator.h
@@ -336,7 +336,8 @@
     auto* end = reinterpret_cast<uint8_t*>(ptr) + aligned_ptr_size;
     // If we haven't allocated anything else, we can safely extend.
     if (end == ptr_) {
-      DCHECK(!IsRunningOnMemoryTool());  // Red zone prevents end == ptr_.
+      // Red zone prevents end == ptr_ (unless input = allocator state = null).
+      DCHECK(!IsRunningOnMemoryTool() || ptr_ == nullptr);
       const size_t aligned_new_size = RoundUp(new_size, kAlignment);
       const size_t size_delta = aligned_new_size - aligned_ptr_size;
       // Check remain space.