Skip to content

Commit a0c19d4

Browse files
Interpreter: fix exceptions thrown during class resolution
1 parent 39e0605 commit a0c19d4

File tree

1 file changed

+8
-13
lines changed
  • substratevm/src/com.oracle.svm.interpreter/src/com/oracle/svm/interpreter

1 file changed

+8
-13
lines changed

substratevm/src/com.oracle.svm.interpreter/src/com/oracle/svm/interpreter/Interpreter.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,9 +1497,8 @@ private static InterpreterResolvedJavaType resolveType(InterpreterResolvedJavaMe
14971497
missingType = unresolvedJavaType;
14981498
}
14991499
throw noClassDefFoundError(opcode, missingType);
1500-
} catch (ClassFormatError e) {
1501-
// Out-of-bounds CPI or mis-matching tag.
1502-
throw SemanticJavaException.raise(e);
1500+
} catch (Throwable t) {
1501+
throw SemanticJavaException.raise(t);
15031502
}
15041503
}
15051504

@@ -1512,10 +1511,8 @@ private static InterpreterResolvedJavaType resolveTypeOrNullIfUnresolvable(Inter
15121511
return getConstantPool(method).resolvedTypeAt(method.getDeclaringClass(), cpi);
15131512
} catch (UnsupportedResolutionException e) {
15141513
return null;
1515-
} catch (ClassFormatError e) {
1516-
// Out-of-bounds CPI or mis-matching tag.
1517-
// Unrelated to resolution, just propagate the error.
1518-
throw SemanticJavaException.raise(e);
1514+
} catch (Throwable t) {
1515+
throw SemanticJavaException.raise(t);
15191516
}
15201517
}
15211518

@@ -1533,9 +1530,8 @@ private static InterpreterResolvedJavaMethod resolveMethod(InterpreterResolvedJa
15331530
missingMethod = unresolvedJavaMethod;
15341531
}
15351532
throw noSuchMethodError(opcode, missingMethod);
1536-
} catch (ClassFormatError e) {
1537-
// Out-of-bounds CPI or mis-matching tag.
1538-
throw SemanticJavaException.raise(e);
1533+
} catch (Throwable t) {
1534+
throw SemanticJavaException.raise(t);
15391535
}
15401536
}
15411537

@@ -1553,9 +1549,8 @@ private static InterpreterResolvedJavaField resolveField(InterpreterResolvedJava
15531549
missingField = unresolvedJavaField;
15541550
}
15551551
throw noSuchFieldError(opcode, missingField);
1556-
} catch (ClassFormatError e) {
1557-
// Out of bounds CPI or mis-matching tag.
1558-
throw SemanticJavaException.raise(e);
1552+
} catch (Throwable t) {
1553+
throw SemanticJavaException.raise(t);
15591554
}
15601555
}
15611556

0 commit comments

Comments
 (0)