Skip to content

Commit 3792a0f

Browse files
committed
Throw on missing type.
1 parent 38ae0f9 commit 3792a0f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageHeap.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,8 @@ public void registerAsImmutable(Object root, Predicate<Object> includeObject) {
282282
Object cur = worklist.pop();
283283
registerAsImmutable(cur);
284284

285-
if (!hMetaAccess.optionalLookupJavaType(cur.getClass()).isPresent()) {
286-
/*
287-
* The type is unused (actually was never created by the static analysis), so we do
288-
* not need to follow any children.
289-
*/
285+
if (hMetaAccess.optionalLookupJavaType(cur.getClass()).isEmpty()) {
286+
throw VMError.shouldNotReachHere("Type missing from static analysis: " + cur.getClass().getTypeName());
290287
} else if (cur instanceof Object[]) {
291288
for (Object element : ((Object[]) cur)) {
292289
addToWorklist(aUniverse.replaceObject(element), includeObject, worklist, registeredObjects);

0 commit comments

Comments
 (0)