diff options
author | 2014-07-17 18:32:41 +0100 | |
---|---|---|
committer | 2014-07-22 16:07:59 +0100 | |
commit | f12feb8e0e857f2832545b3f28d31bad5a9d3903 (patch) | |
tree | 0a7320caf995441ea4577875abaf731fc37dd0a9 /test/401-optimizing-compiler/src/Main.java | |
parent | ebb6b5c90857f390db5a4f840bbe67b3a59a22d8 (diff) |
Stack overflow checks and NPE checks for optimizing.
Change-Id: I59e97448bf29778769b79b51ee4ea43f43493d96
Diffstat (limited to 'test/401-optimizing-compiler/src/Main.java')
-rw-r--r-- | test/401-optimizing-compiler/src/Main.java | 21 |
1 files changed, 21 insertions, 0 deletions
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) { |