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
Caused by: com.ibm.wala.util.debug.UnimplementedError: Unexpected type: class com.ibm.wala.analysis.typeInference.JavaPrimitiveType
at com.ibm.wala.util.debug.Assertions.UNREACHABLE(Assertions.java:55)
at com.ibm.wala.analysis.typeInference.PointType.meet(PointType.java:69)
at com.ibm.wala.analysis.typeInference.TypeInference$PrimitivePropagateOperator.evaluate(TypeInference.java:392)
at com.ibm.wala.cast.java.analysis.typeInference.AstJavaTypeInference$PrimAndStringOp.evaluate(AstJavaTypeInference.java:142)
at com.ibm.wala.analysis.typeInference.TypeInference$PrimitivePropagateOperator.evaluate(TypeInference.java:1)
at com.ibm.wala.fixedpoint.impl.GeneralStatement.evaluate(GeneralStatement.java:36)
at com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver.solve(AbstractFixedPointSolver.java:149)
at com.ibm.wala.analysis.typeInference.TypeInference.solve(TypeInference.java:126)
at com.ibm.wala.analysis.typeInference.TypeInference.solve(TypeInference.java:117)
at com.ibm.wala.analysis.typeInference.TypeInference.<init>(TypeInference.java:113)
at com.ibm.wala.cast.analysis.typeInference.AstTypeInference.<init>(AstTypeInference.java:70)
at com.ibm.wala.cast.java.analysis.typeInference.AstJavaTypeInference.<init>(AstJavaTypeInference.java:98)
at edu.illinois.jflow.jflow.wala.dataflowanalysis.ProgramDependenceGraph.<init>(ProgramDependenceGraph.java:80)
at edu.illinois.jflow.jflow.wala.dataflowanalysis.ProgramDependenceGraph.makeWithSourceCode(ProgramDependenceGraph.java:65)
at edu.illinois.jflow.core.transformations.code.ExtractClosureRefactoring.createPDGAnalyzer(ExtractClosureRefactoring.java:302)
Here's the offending code:
package extractclosure;
public class Project1 {
public static void main(String[] args) {
int a = producer(1);
/*[*/
int b = producer(a);
int c = producer(b);
System.out.println("a: " + a + ", c: " + c); // <--- This line here, if we remove it al is well.
/*]*/
}
static int producer(int input) {
return input + 2;
}
}
The text was updated successfully, but these errors were encountered:
This is probably because the "a: " + a gets translated into a binaryop(add) and that confuses Wala since it is not expecting the + on a string and an integer.
I confirm this by replacing the offending line with
int b = producer(a);
int c = producer(b);
System.out.println(String.format("a: %s, b: %s", a, b)); // <-- this avoid the binaryop(add) that confuses Wala
After more investigation, the culprit for this is actually
public AstJavaTypeInference(IR ir, IClassHierarchy cha, boolean doPrimitives) {
super(ir, cha, JavaPrimitiveType.BOOLEAN, doPrimitives);
this.stringClass = cha.lookupClass(TypeReference.JavaLangString);
}
The field, stringClass, is not initialized in time. That is because the call to super actually calls the call to initialize() and solve, which will cause trouble when you try to compare the types.
Here's the stack trace
Here's the offending code:
The text was updated successfully, but these errors were encountered: