Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayIndexOutOfBoundsException #428

Open
jacob-lerenius opened this issue Aug 22, 2024 · 3 comments
Open

ArrayIndexOutOfBoundsException #428

jacob-lerenius opened this issue Aug 22, 2024 · 3 comments

Comments

@jacob-lerenius
Copy link

I get an issue when running Proguard. Attached log:

ProGuard, version 7.5.0
Unexpected error
java.lang.ArrayIndexOutOfBoundsException: -1
at proguard.evaluation.Stack.getTop(Stack.java:181) ~[proguard.jar:7.5.0]
at proguard.classfile.util.ArrayInitializationMatcher.matchesArrayInitialization(ArrayInitializationMatcher.java:98) ~[proguard.jar:7.5.0]
at proguard.classfile.util.ArrayInitializationReplacer.visitAnyInstruction(ArrayInitializationReplacer.java:105) ~[proguard.jar:7.5.0]
at proguard.classfile.instruction.visitor.InstructionVisitor.visitSimpleInstruction(InstructionVisitor.java:50) ~[proguard.jar:7.5.0]
at proguard.classfile.instruction.SimpleInstruction.accept(SimpleInstruction.java:255) ~[proguard.jar:7.5.0]
at proguard.classfile.attribute.CodeAttribute.instructionsAccept(CodeAttribute.java:136) ~[proguard.jar:7.5.0]
at proguard.classfile.attribute.CodeAttribute.instructionsAccept(CodeAttribute.java:111) ~[proguard.jar:7.5.0]
at proguard.classfile.util.ArrayInitializationReplacer.visitCodeAttribute(ArrayInitializationReplacer.java:86) ~[proguard.jar:7.5.0]
at proguard.classfile.util.ArrayInitializationReplacer$ArrayInitializationFilter.visitCodeAttribute(ArrayInitializationReplacer.java:162) ~[proguard.jar:7.5.0]
at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:105) ~[proguard.jar:7.5.0]
at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:118) ~[proguard.jar:7.5.0]
at proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember(AllAttributeVisitor.java:77) ~[proguard.jar:7.5.0]
at proguard.classfile.visitor.MemberVisitor.visitProgramMethod(MemberVisitor.java:47) ~[proguard.jar:7.5.0]
at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:113) ~[proguard.jar:7.5.0]
at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:589) ~[proguard.jar:7.5.0]
at proguard.classfile.util.ArrayInitializationReplacer.visitProgramClass(ArrayInitializationReplacer.java:70) ~[proguard.jar:7.5.0]
at proguard.classfile.ProgramClass.accept(ProgramClass.java:491) ~[proguard.jar:7.5.0]
at proguard.classfile.ClassPool.classesAccept(ClassPool.java:214) ~[proguard.jar:7.5.0]
at proguard.classfile.pass.PrimitiveArrayConstantIntroducer.execute(PrimitiveArrayConstantIntroducer.java:22) ~[proguard.jar:7.5.0]
at proguard.pass.PassRunner.run(PassRunner.java:24) ~[proguard.jar:7.5.0]
at proguard.ProGuard.introducePrimitiveArrayConstants(ProGuard.java:394) ~[proguard.jar:7.5.0]
at proguard.ProGuard.execute(ProGuard.java:163) ~[proguard.jar:7.5.0]
at proguard.ProGuard.main(ProGuard.java:648) ~[proguard.jar:7.5.0]

@mrjameshamilton
Copy link
Contributor

HI @jacob-lerenius ! Can you provide a reproducing sample?

@jacob-lerenius
Copy link
Author

Unfortunately I'm not allowed to upload the project. I thought it may be some way to handle if the index is -1 anyways. I can help testing a possible solution if it helps. Sorry

@mrjameshamilton
Copy link
Contributor

Unfortunately without a reproducing sample it's not obvious what the issue is. Handling the -1 case in that location would be handling a symptom of the problem rather than fixing the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants