diff --git a/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java b/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java index ecfca10edd6ee41b85634fd68e4349f0253e0936..408cf993463530cb270b85115de7f20efc82b6b3 100644 --- a/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java +++ b/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java @@ -168,6 +168,11 @@ public class CatchExceptionTest { try { returned = target.invokeWithArguments(args); } catch (Throwable ex) { + if (CodeCacheOverflowProcessor.isThrowableCausedByVME(ex)) { + // This error will be treated by CodeCacheOverflowProcessor + // to prevent the test from failing because of code cache overflow. + throw new Error(ex); + } testCase.assertCatch(ex); returned = ex; }