From 53f539beb8275494d851563a3a63c378e4aab7ff Mon Sep 17 00:00:00 2001 From: Robert Grosse Date: Sat, 31 Dec 2016 15:17:57 -0800 Subject: [PATCH] Add test for checkcast of nonexistent class (#105) --- tests/decompiler/__init__.py | 1 + .../decompiler/classes/NonexistentCheckcast.class | Bin 0 -> 151 bytes tests/decompiler/source/BadInnerTest.j | 2 +- tests/decompiler/source/NonexistentCheckcast.j | 12 ++++++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/decompiler/classes/NonexistentCheckcast.class create mode 100644 tests/decompiler/source/NonexistentCheckcast.j diff --git a/tests/decompiler/__init__.py b/tests/decompiler/__init__.py index cdc63f0e..a3d2bb7d 100644 --- a/tests/decompiler/__init__.py +++ b/tests/decompiler/__init__.py @@ -13,6 +13,7 @@ 'floattest': ([],), 'JSRTests': ([], ['x'], ['x', 'x', 'x', 'x']), 'LClassLiteralTest': ([],), + # 'NonexistentCheckcast': ([],), 'NullInference': ([], ['alice'], ['bob', 'carol']), 'OddsAndEnds': ([], ['x'], ['42'], ['4'], ['-2'], ['-0x567'], ['-5678']), 'splitnew': ([], ['-0'], ['-0', ''], ['-0', '', '', ''], diff --git a/tests/decompiler/classes/NonexistentCheckcast.class b/tests/decompiler/classes/NonexistentCheckcast.class new file mode 100644 index 0000000000000000000000000000000000000000..1cd439c83566edc78bcb387e7176ea9a2b017940 GIT binary patch literal 151 zcmX^0Z`VEs1_nb0E_Mb^b_Nbc2A15!%sfU0F^y=Sti-ZJ{hY+Sbp7CxqRhN>Yt1mA zymNj^Dmw!^BLj1JNg5-A078|2QdVkm2_u7uUw&R{MP_kHYF>$RMrv|)a$<1_10xVJ j0qtS{(wq#;3@kvJ70450-~vJh23E!c3~U=g@(c_BA@3jM literal 0 HcmV?d00001 diff --git a/tests/decompiler/source/BadInnerTest.j b/tests/decompiler/source/BadInnerTest.j index f208e870..796fc6bc 100644 --- a/tests/decompiler/source/BadInnerTest.j +++ b/tests/decompiler/source/BadInnerTest.j @@ -13,4 +13,4 @@ ldc "Bad inners, bad inners, whatcha gonna do?" invokevirtual java/io/PrintStream println (Ljava/lang/Object;)V return -.end method \ No newline at end of file +.end method diff --git a/tests/decompiler/source/NonexistentCheckcast.j b/tests/decompiler/source/NonexistentCheckcast.j new file mode 100644 index 00000000..90481e6c --- /dev/null +++ b/tests/decompiler/source/NonexistentCheckcast.j @@ -0,0 +1,12 @@ +; Originally created as a test for Krakatau (https://github.com/Storyyeller/Krakatau) +.class public NonexistentCheckcast +.super java/lang/Object + +.method public static main : ([Ljava/lang/String;)V + .limit stack 10 + .limit locals 10 + + aconst_null + checkcast wtf + return +.end method