< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/MethodWriter.java

Print this page

        

@@ -2059,11 +2059,11 @@
         if (classReaderOffset != 0) {
             return 6 + classReaderLength;
         }
         int size = 8;
         if (code.length > 0) {
-            if (code.length > 65536) {
+            if (code.length > 65535) {
                 throw new RuntimeException("Method code too large!");
             }
             cw.newUTF8("Code");
             size += 18 + code.length + 8 * handlerCount;
             if (localVar != null) {

@@ -2733,17 +2733,19 @@
                 }
                 getNewOffset(allIndexes, allSizes, l);
                 l = l.successor;
             }
             // Update the offsets in the uninitialized types
+            if (cw.typeTable != null) {
             for (i = 0; i < cw.typeTable.length; ++i) {
                 Item item = cw.typeTable[i];
                 if (item != null && item.type == ClassWriter.TYPE_UNINIT) {
                     item.intVal = getNewOffset(allIndexes, allSizes, 0,
                             item.intVal);
                 }
             }
+            }
             // The stack map frames are not serialized yet, so we don't need
             // to update them. They will be serialized in visitMaxs.
         } else if (frameCount > 0) {
             /*
              * Resizing an existing stack map frame table is really hard. Not
< prev index next >