Skip to content

Aggregator type cast bug #739

@virusdefender

Description

@virusdefender
public class Main  {
  public static void main(String[] args) {
    int a = Integer.valueOf(args[0]);
    int b = a;
    int c = b;
    System.out.println(a + b + c);

  }
}

and then enable body interceptor

view.configBodyInterceptors{
        BytecodeClassLoadingOptions.Default
    }
java.lang.IllegalStateException: Failed to apply sootup.java.bytecode.interceptors.Aggregator@662ac478 to <Main: void main(java.lang.String[])>
	at sootup.java.bytecode.frontend.AsmMethodSource.resolveBody(AsmMethodSource.java:229)
	at sootup.core.model.SootMethod.lazyBodyInitializer(SootMethod.java:98)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:183)
	at sootup.core.model.SootMethod.getBody(SootMethod.java:177)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
	at picocli.CommandLine.execute(CommandLine.java:2078)
Caused by: java.lang.ClassCastException: class sootup.core.jimple.common.expr.JAddExpr cannot be cast to class sootup.core.jimple.basic.Immediate (sootup.core.jimple.common.expr.JAddExpr and sootup.core.jimple.basic.Immediate are in unnamed module of loader 'app')
	at sootup.java.bytecode.interceptors.Aggregator.interceptBody(Aggregator.java:196)
	at sootup.java.bytecode.frontend.AsmMethodSource.resolveBody(AsmMethodSource.java:226)
	... 13 more

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions