Handle NULL return from class loader.
The VM was asserting that it couldn't happen, when it fact it can quite
easily if a class loader is broken.
Bug 2817346.
Change-Id: Id2a4edab428a0ef0fa9aabc8e4a7f6a4d614fb9e
diff --git a/vm/oo/Class.c b/vm/oo/Class.c
index 2776100..d708bb8 100644
--- a/vm/oo/Class.c
+++ b/vm/oo/Class.c
@@ -1292,8 +1292,11 @@
dvmReleaseTrackedAlloc(excep, self);
clazz = NULL;
goto bail;
- } else {
- assert(clazz != NULL);
+ } else if (clazz == NULL) {
+ LOGW("ClassLoader returned NULL w/o exception pending\n");
+ dvmThrowException("Ljava/lang/NullPointerException;",
+ "ClassLoader returned null");
+ goto bail;
}
dvmAddInitiatingLoader(clazz, loader);