From f12feb8e0e857f2832545b3f28d31bad5a9d3903 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 17 Jul 2014 18:32:41 +0100 Subject: Stack overflow checks and NPE checks for optimizing. Change-Id: I59e97448bf29778769b79b51ee4ea43f43493d96 --- test/401-optimizing-compiler/src/Main.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/401-optimizing-compiler/src/Main.java') diff --git a/test/401-optimizing-compiler/src/Main.java b/test/401-optimizing-compiler/src/Main.java index 0d8eeb94a6..2c6d1c2b60 100644 --- a/test/401-optimizing-compiler/src/Main.java +++ b/test/401-optimizing-compiler/src/Main.java @@ -85,6 +85,27 @@ public class Main { Object o = new byte[1024]; } } + + // Test that we do NPE checks on invokedirect. + Exception exception = null; + try { + invokePrivate(); + } catch (NullPointerException e) { + exception = e; + } + + if (exception == null) { + throw new Error("Missing NullPointerException"); + } + } + + public static void invokePrivate() { + Main m = null; + m.privateMethod(); + } + + private void privateMethod() { + Object o = new Object(); } static int $opt$TestInvokeIntParameter(int param) { -- cgit v1.2.3-59-g8ed1b