Hi, I have a code that works properly before the update version of WALA. But after I updated to the new version, getNumberOfParameters does not work. It give me error _
The method getNumberOfParameters() is undefined for the type JavaScriptInvoke
_.
The previous version of WALA does not give me error like this. When I check the library com.ibm.wala.cast.js.ssa.JavaScriptInvoke I realize that the method getNumberOfParameters was not available under that libaray. Are there any equivalance method that can be used?
Below is the code
@Override
public IntSet getTargets(int d1) {
if (!(domain.getMappedObject(d1) instanceof FlowFact)) return EmptyIntSet.instance;
FlowFact fact = (FlowFact) domain.getMappedObject(d1);
MutableIntSet result = MutableSparseIntSet.makeEmpty();
if (AnalysisUtil.isRelated(fact, call, src, dest)) result.add(d1);
if (call.getLastInstruction() instanceof JavaScriptInvoke && src.getNode() == fact.getNode()) {
// An object that was given to a function was modified in that function
// -> also track the object in the caller scope
// call ExplodedBlock[36](original:BB[SSA:35..35]13 - test2.nodejsModule.moduleSource.do()LRoot;)
// 43 = invoke 16@35 44,40,31,46 exception:47
// src ExplodedBlock[3](exit:<Code body of function Ltest2/nodejsModule/moduleSource/obfuscate>)
// null
JavaScriptInvoke instr = (JavaScriptInvoke) call.getLastInstruction();
// Make sure that the modified variable is one of the parameters and not
// a local variable within the called function
if (fact.getVar() <= instr.getNumberOfParameters()) {
FlowFact factToAdd = new FlowFact(call.getNode(), instr.getUse(fact.getVar() - 1), fact.getFields());
AnalysisUtil.addFact(domain, result, factToAdd);
}
}
return result;
We are moving to support Python, which has both positional and keyword arguments, hence that method has been renamed to getNumberOfPositionalParameters.
Hi, I have a code that works properly before the update version of WALA. But after I updated to the new version, getNumberOfParameters does not work. It give me error _
_.
The previous version of WALA does not give me error like this. When I check the library com.ibm.wala.cast.js.ssa.JavaScriptInvoke I realize that the method getNumberOfParameters was not available under that libaray. Are there any equivalance method that can be used?
Below is the code