Version 1.6.38

Cherry-pick: Don't allow type lookup of null value.
CL: https://r8-review.googlesource.com/c/r8/+/44433

Cherry-pick: Use concurrent hash map instead of synchronized map.
CL: https://r8-review.googlesource.com/c/r8/+/44431

Bug: 141096337
Change-Id: I7dc4d17b4831eafc16ba0155f1b1e69a9bdec2ba
diff --git a/src/main/java/com/android/tools/r8/Version.java b/src/main/java/com/android/tools/r8/Version.java
index 1be5bda..42f429f 100644
--- a/src/main/java/com/android/tools/r8/Version.java
+++ b/src/main/java/com/android/tools/r8/Version.java
@@ -11,7 +11,7 @@
 
   // This field is accessed from release scripts using simple pattern matching.
   // Therefore, changing this field could break our release scripts.
-  public static final String LABEL = "1.6.37";
+  public static final String LABEL = "1.6.38";
 
   private Version() {
   }
diff --git a/src/main/java/com/android/tools/r8/graph/AppInfoWithSubtyping.java b/src/main/java/com/android/tools/r8/graph/AppInfoWithSubtyping.java
index 2e37930..c4e704c 100644
--- a/src/main/java/com/android/tools/r8/graph/AppInfoWithSubtyping.java
+++ b/src/main/java/com/android/tools/r8/graph/AppInfoWithSubtyping.java
@@ -125,7 +125,7 @@
 
   public AppInfoWithSubtyping(DexApplication application) {
     super(application);
-    typeInfo = Collections.synchronizedMap(new IdentityHashMap<>());
+    typeInfo = new ConcurrentHashMap<>();
     // Recompute subtype map if we have modified the graph.
     populateSubtypeMap(application.asDirect(), application.dexItemFactory);
   }
@@ -134,7 +134,7 @@
     super(previous);
     missingClasses.addAll(previous.missingClasses);
     subtypeMap.putAll(previous.subtypeMap);
-    typeInfo = Collections.synchronizedMap(new IdentityHashMap<>(previous.typeInfo));
+    typeInfo = new ConcurrentHashMap<>(previous.typeInfo);
     assert app() instanceof DirectMappedDexApplication;
   }
 
@@ -205,6 +205,7 @@
   }
 
   private TypeInfo getTypeInfo(DexType type) {
+    assert type != null;
     return typeInfo.computeIfAbsent(type, TypeInfo::new);
   }
 
@@ -268,11 +269,11 @@
       }
       assert !seenTypes.contains(next);
       seenTypes.add(next);
-      TypeInfo superInfo = getTypeInfo(superType);
       TypeInfo nextInfo = getTypeInfo(next);
       if (superType == null) {
         assert nextInfo.hierarchyLevel == ROOT_LEVEL;
       } else {
+        TypeInfo superInfo = getTypeInfo(superType);
         assert superInfo.hierarchyLevel == nextInfo.hierarchyLevel - 1
             || (superInfo.hierarchyLevel == ROOT_LEVEL
                 && nextInfo.hierarchyLevel == INTERFACE_LEVEL);