Skip to content

ClassCastException in ReplaceUseStmtVisitor #402

@kadirayk

Description

@kadirayk

Can be reproduced with the latest commit in this branch: https://github.com/secure-software-engineering/soot-reloaded/tree/bugfix/classCastExInReplaceUseStmtVisitor

stack trace:

java.lang.RuntimeException: Failed to convert <com.sun.xml.internal.stream.writers.XMLStreamWriterImpl: void writeXMLContent(char[],int,int,boolean)>

	at de.upb.swt.soot.java.bytecode.frontend.AsmMethodSource.resolveBody(AsmMethodSource.java:214)
	at de.upb.swt.soot.core.model.SootMethod.lazyBodyInitializer(SootMethod.java:95)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:166)
	at de.upb.swt.soot.core.model.SootMethod.getBody(SootMethod.java:134)
	at de.upb.swt.soot.callgraph.AbstractCallGraphAlgorithm.resolveAllCallsFromSourceMethod(AbstractCallGraphAlgorithm.java:106)
	at de.upb.swt.soot.callgraph.AbstractCallGraphAlgorithm.processWorkList(AbstractCallGraphAlgorithm.java:82)
	at de.upb.swt.soot.callgraph.AbstractCallGraphAlgorithm.constructCompleteCallGraph(AbstractCallGraphAlgorithm.java:61)
	at de.upb.swt.soot.callgraph.ClassHierarchyAnalysisAlgorithm.initialize(ClassHierarchyAnalysisAlgorithm.java:47)
	at de.upb.swt.soot.test.callgraph.CallGraphTestBase.loadCallGraph(CallGraphTestBase.java:64)
	at de.upb.swt.soot.test.callgraph.CallGraphTestBase.testHelloWorld(CallGraphTestBase.java:371)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: java.lang.ClassCastException: de.upb.swt.soot.core.jimple.common.expr.JAddExpr cannot be cast to de.upb.swt.soot.core.jimple.basic.Immediate
	at de.upb.swt.soot.core.jimple.visitor.ReplaceUseStmtVisitor.caseAssignStmt(ReplaceUseStmtVisitor.java:90)
	at de.upb.swt.soot.core.jimple.common.stmt.JAssignStmt.accept(JAssignStmt.java:186)
	at de.upb.swt.soot.core.jimple.common.stmt.JAssignStmt.accept(JAssignStmt.java:37)
	at de.upb.swt.soot.java.bytecode.frontend.Operand.updateUsages(Operand.java:98)
	at de.upb.swt.soot.java.bytecode.frontend.StackFrame.mergeIn(StackFrame.java:149)
	at de.upb.swt.soot.java.bytecode.frontend.AsmMethodSource.convertVarStoreInsn(AsmMethodSource.java:1575)
	at de.upb.swt.soot.java.bytecode.frontend.AsmMethodSource.convertVarInsn(AsmMethodSource.java:1585)
	at de.upb.swt.soot.java.bytecode.frontend.AsmMethodSource.convert(AsmMethodSource.java:1768)
	at de.upb.swt.soot.java.bytecode.frontend.AsmMethodSource.resolveBody(AsmMethodSource.java:211)
	... 31 more

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions