You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the Java ByteCode contains an instruction that is invalid, the error message totally misses the point.
For example:
import java.lang.String;
import java.lang.System;
import java.io.PrintStream;
version 12;
public class MyClass {
public static void main(final String[] args) {
getstatic System#PrintStream out
apples
ldc "Hello World!"
invokevirtual PrintStream#void println(String)
return
}
}
Results in a stack trace
Exception in thread "main" java.io.IOException: An exception occured while assembling HelloWorld.jbc
at com.guardsquare.proguard.assembler.io.JbcReader.read(JbcReader.java:78)
at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:85)
at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:85)
at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:85)
at proguard.io.FileSource.pumpDataEntries(FileSource.java:71)
at com.guardsquare.proguard.assembler.AssemblerCli.readInput(AssemblerCli.java:156)
at com.guardsquare.proguard.assembler.AssemblerCli.main(AssemblerCli.java:79)
Caused by: com.guardsquare.proguard.assembler.ParseException: Line 9: An exception occured while parsing main(java.lang.String[])
at com.guardsquare.proguard.assembler.InstructionsParser.visitProgramMethod(InstructionsParser.java:94)
at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:140)
at com.guardsquare.proguard.assembler.ClassMembersParser.visitProgramMethod(ClassMembersParser.java:182)
at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:140)
at com.guardsquare.proguard.assembler.ClassMembersParser.visitProgramClass(ClassMembersParser.java:102)
at proguard.classfile.ProgramClass.accept(ProgramClass.java:544)
at com.guardsquare.proguard.assembler.ClassParser.visitProgramClass(ClassParser.java:170)
at proguard.classfile.ProgramClass.accept(ProgramClass.java:544)
at com.guardsquare.proguard.assembler.io.JbcReader.read(JbcReader.java:69)
... 6 more
Caused by: com.guardsquare.proguard.assembler.ParseException: Line 9: Expected label colon ':' but got word.
at com.guardsquare.proguard.assembler.Parser.expect(Parser.java:117)
at com.guardsquare.proguard.assembler.Parser.expect(Parser.java:202)
at com.guardsquare.proguard.assembler.InstructionsParser.visitCodeAttribute(InstructionsParser.java:220)
at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:138)
at com.guardsquare.proguard.assembler.InstructionsParser.visitProgramMethod(InstructionsParser.java:84)
... 14 more
As can be seen, the error points to line 9 even though this is unrelated. The example here is clear, apples is clearly not a valid instruction, but a typo in an instruction like astore_0 is easier to be made.
The text was updated successfully, but these errors were encountered:
When the Java ByteCode contains an instruction that is invalid, the error message totally misses the point.
For example:
Results in a stack trace
As can be seen, the error points to line 9 even though this is unrelated. The example here is clear,
apples
is clearly not a valid instruction, but a typo in an instruction likeastore_0
is easier to be made.The text was updated successfully, but these errors were encountered: