]> source.dussan.org Git - aspectj.git/commitdiff
fix for 435446: ensure size of invokedynamic correct
authorAndy Clement <aclement@gopivotal.com>
Fri, 23 May 2014 20:25:57 +0000 (13:25 -0700)
committerAndy Clement <aclement@gopivotal.com>
Fri, 23 May 2014 20:25:57 +0000 (13:25 -0700)
bcel-builder/src/org/aspectj/apache/bcel/ConstantsInitializer.java
lib/bcel/bcel-src.zip
lib/bcel/bcel-verifier-src.zip
lib/bcel/bcel-verifier.jar
lib/bcel/bcel.jar
tests/bugs181/435446/Application.java [new file with mode: 0644]
tests/bugs181/435446/MyAspect.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc181/Ajc181Tests.java
tests/src/org/aspectj/systemtest/ajc181/ajc181.xml

index 2196df3e76d97cd8285eb143754a33c31152b779..9e19c417dec7d61566b36bfb863a28dff2af7f21 100644 (file)
@@ -337,20 +337,22 @@ public class ConstantsInitializer {
                                | Constants.INDEXED;
                Constants.instExcs[Constants.INVOKEVIRTUAL] = ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION_INVOKESPECIAL_INVOKEVIRTUAL;
 
+               //@formatter:off
                char[] lengths = // . = varies in length, / = undefined
                ("1111111111111111" + // nop > dconst_1
-                               "2323322222111111" + // bipush > lload_1
-                               "1111111111111111" + // lload_2 > laload
-                               "1111112222211111" + // faload > lstore_0
-                               "1111111111111111" + // lstore_1 > iastore
-                               "1111111111111111" + // lastore > swap
-                               "1111111111111111" + // iadd > ddiv
-                               "1111111111111111" + // irem > land
-                               "1111311111111111" + // ior > d2l
-                               "1111111113333333" + // d2f > if_icmpeq
-                               "3333333332..1111" + // if_icmpne > dreturn
-                               "1133333335/32311" + // areturn > athrow
-                               "3311.433551/////").toCharArray(); // checkcast >
+                "2323322222111111" + // bipush > lload_1
+                "1111111111111111" + // lload_2 > laload
+                "1111112222211111" + // faload > lstore_0
+                "1111111111111111" + // lstore_1 > iastore
+                "1111111111111111" + // lastore > swap
+                "1111111111111111" + // iadd > ddiv
+                "1111111111111111" + // irem > land
+                "1111311111111111" + // ior > d2l
+                "1111111113333333" + // d2f > if_icmpeq
+                "3333333332..1111" + // if_icmpne > dreturn
+                "1133333335532311" + // areturn > athrow
+                "3311.433551/////").toCharArray(); // checkcast >
+               //@formatter:on
                int count = 0;
                for (; count < lengths.length; count++) {
                        Constants.iLen[count] = (byte) (lengths[count] - 48);
@@ -374,7 +376,7 @@ public class ConstantsInitializer {
                                "1212021211212212" + // ior > d2l
                                "1111111110000000" + // d2f > if_icmpeq
                                "0000000010000000" + // if_icmpne > dreturn
-                               "00.0.0..../11111" + // areturn > athrow
+                               "00.0.0.....11111" + // areturn > athrow
                                "11000100010/").toCharArray(); // checkcast >
                count = 0;
                for (; count < producesOnStack.length; count++) {
index 9150034a6787e2cf053222830f4e23ebe4d1cbed..090f7083aef6d92b0f512b328084f6cb90e643c7 100644 (file)
Binary files a/lib/bcel/bcel-src.zip and b/lib/bcel/bcel-src.zip differ
index ba3f777d146700088fbbcae24ea857870d1479a9..bf5a86a3e8bfe2f9367f79f53bdb3ae7b04e5370 100644 (file)
Binary files a/lib/bcel/bcel-verifier-src.zip and b/lib/bcel/bcel-verifier-src.zip differ
index a86266c05ed58bb99e498d92795910c2cc88c7ba..c407530cf93fb336a5a5e394925e703335567c8e 100644 (file)
Binary files a/lib/bcel/bcel-verifier.jar and b/lib/bcel/bcel-verifier.jar differ
index 3a1fb89e505cfe2142e8896786ea8e3617913bff..20e2af40c2e5d34523be6acfe193a927623e9149 100644 (file)
Binary files a/lib/bcel/bcel.jar and b/lib/bcel/bcel.jar differ
diff --git a/tests/bugs181/435446/Application.java b/tests/bugs181/435446/Application.java
new file mode 100644 (file)
index 0000000..f332729
--- /dev/null
@@ -0,0 +1,37 @@
+package de.scrum_master.app;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Application {
+       static Map/*<String, Map<Integer, String>>*/ languages = new HashMap<>();
+       
+       static {
+               Map<Integer, String> englishNumbers = new HashMap<>();
+               englishNumbers.put(11, "eleven");
+               englishNumbers.put(12, "twelve");
+               englishNumbers.put(13, "thirteen");
+               languages.put("EN", englishNumbers);
+
+               Map<Integer, String> germanNumbers = new HashMap<>();
+               germanNumbers.put(11, "elf");
+               germanNumbers.put(12, "zwölf");
+               germanNumbers.put(13, "dreizehn");
+               languages.put("DE", germanNumbers);
+
+               
+       }
+       
+       public static void main(String[] args) {
+               languages.entrySet().stream().forEach((language) -> {
+//                     String languageCode = language.getKey();
+                       Map/*<Integer, String>*/ numbers =  (Map)((Map.Entry)language).getValue();
+//                     System.out.println("Language code = " + languageCode);
+                       numbers.entrySet().stream().forEach((number) -> {
+//                             int numericValue = number.getKey();
+//                             String textualValue = number.getValue();
+//                             System.out.println("  " + numericValue + " -> " + textualValue);
+                       });
+               });
+       }
+}
diff --git a/tests/bugs181/435446/MyAspect.java b/tests/bugs181/435446/MyAspect.java
new file mode 100644 (file)
index 0000000..fb45a51
--- /dev/null
@@ -0,0 +1,9 @@
+package de.scrum_master.aspect;
+
+import de.scrum_master.app.Application;
+
+public aspect MyAspect {
+  before() : execution(* Application.lambda$0(..)) {
+//     System.out.println(thisJoinPointStaticPart);
+  }
+}
index 2bc5e0c0c1045b2ab1fb8a4eb17c8c75432a234b..3fc5e17cd717a67f80d6d0babc4ecd7eb4e8f8a2 100644 (file)
@@ -22,6 +22,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
  */
 public class Ajc181Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testLvarTable_435446() throws Exception {
+               runTest("lvartable");
+       }
+       
        public void testBrokenAnnotations_377096() throws Exception {
                runTest("broken annotations");
                Method method = getMethodFromClass(getClassFrom(ajc.getSandboxDirectory(), "C"), "xxx");
index cd2066506c8e3b338604233c36e9a8058454691b..fdbe11d21aeafd29508e82158060d669ea8bc487 100644 (file)
@@ -2,6 +2,13 @@
 
 <suite>
 
+       <ajc-test dir="bugs181/435446" title="lvartable">
+               <compile options="-1.8" files="Application.java MyAspect.java">
+               </compile>
+               <run class="de.scrum_master.app.Application">
+               </run>
+       </ajc-test>
+       
        <ajc-test dir="bugs181/377096" title="broken annotations">
                <compile options="-1.5 -proceedOnError" files="A.java">
                <message kind="error" text="The attribute wibble is undefined for the annotation type A"/>