aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/test5
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2016-07-30 16:22:59 +0900
committerchibash <chiba@javassist.org>2016-07-30 16:22:59 +0900
commit7ec83a2e3d3c5f820ee1756d5c7510acf8671d4b (patch)
tree870a8b02f91bd5f481baacb74d83f1898627c75f /src/test/test5
parent5e4572a90f9a11618f5a076ae573932b71a7e13e (diff)
downloadjavassist-7ec83a2e3d3c5f820ee1756d5c7510acf8671d4b.tar.gz
javassist-7ec83a2e3d3c5f820ee1756d5c7510acf8671d4b.zip
fixes a bug of stackmap generation. The bug was reported here: https://github.com/jboss-javassist/javassist/issues/83
Diffstat (limited to 'src/test/test5')
-rw-r--r--src/test/test5/StackmapWithArray83.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/test/test5/StackmapWithArray83.java b/src/test/test5/StackmapWithArray83.java
new file mode 100644
index 00000000..c8333d81
--- /dev/null
+++ b/src/test/test5/StackmapWithArray83.java
@@ -0,0 +1,38 @@
+package test5;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class StackmapWithArray83 {
+ public int run() {
+ bytecodeVerifyError();
+ bytecodeVerifyError2();
+ return 1;
+ }
+
+ public void bytecodeVerifyError() {
+ List<Integer> test = new ArrayList<Integer>();
+ String[] newLine = new String[10];
+ for (Integer idx : test) {
+ String address = newLine[1];
+ int tabPos = -1;
+ if (tabPos != -1) {
+ address = address.substring(tabPos + 1);
+ }
+ newLine[4] = address;
+ }
+ }
+
+ public void bytecodeVerifyError2() {
+ List<Integer> test = new ArrayList<Integer>();
+ int[] newLine = new int[10];
+ for (Integer idx : test) {
+ int address = newLine[1];
+ int tabPos = -1;
+ if (tabPos != -1) {
+ address = address + tabPos;
+ }
+ newLine[4] = address;
+ }
+ }
+}