Menu

#659 java class format error LVTT entry does not match any LVT entry

v5.3.3
open
None
5
2017-08-15
2017-08-10
No

Using Proguard 5.3.3. The error is

java.lang.ClassFormatError: LVTT entry for 'arrayClazz' in class file
net/certiv/dsl/core/DslCore does not match any LVT entry

The error did not occur with Proguard 5.2.1

The relevant code is:

    public IDslElement[] getDslElementArray(Map<String, String> map, String countAttribute, String arrayAttribute,
            int offset, String project, Class<? extends IDslElement> arrayClazz) throws IllegalArgumentException {
        if (countAttribute != null) {
            int count = getInt(map, countAttribute);
            IDslElement[] result = (IDslElement[]) Array.newInstance(arrayClazz, count);
            for (int i = 0; i < count; i++) {
                result[i] = getDslElement(map, getAttributeName(arrayAttribute, i + offset), project);
            }
            return result;
        } else {
            ArrayList<IDslElement> result = new ArrayList<>();
            IDslElement element = null;
            while ((element = getDslElement(map, arrayAttribute, project, true)) != null) {
                result.add(element);
            }
            return (IDslElement[]) result.toArray((Object[]) Array.newInstance(arrayClazz, result.size()));
        }
    }

Related to bugs #376 and #459.

1 Attachments

Discussion

  • Gerald Rosenberg

    Keeping 'LocalVariableTable' alone is not sufficient. Using '-optimizations !code/allocation/variable' does work as a workaround.

     
  • Eric Lafortune

    Eric Lafortune - 2017-08-15

    Thanks for your report. ProGuard's optimization step sometimes has problems keeping the LocalVariableTable up to date as it optimizes the code. The LocalVariableTable is just an attribute with debug information about local variables. Typical programs don't need it, so you can perhaps not keep it explicitly to work around the problem.

    It's difficult to reproduce the problem when I can't compile the code snippet. Can you send me a source file that compiles?

     
  • Eric Lafortune

    Eric Lafortune - 2017-08-15
    • assigned_to: Eric Lafortune
     

Log in to post a comment.