From 8b6bbfe9eaf80955f15a7301363340bb16955919 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Wed, 22 Nov 2023 22:50:58 -0500 Subject: [PATCH 01/27] Add condition for callable. --- .../python/ipa/callgraph/PythonTrampolineTargetSelector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java index 2cec10ac2..d927453ff 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java @@ -46,7 +46,7 @@ public PythonTrampolineTargetSelector(MethodTargetSelector base) { public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) { if (receiver != null) { IClassHierarchy cha = receiver.getClassHierarchy(); - if (cha.isSubclassOf(receiver, cha.lookupClass(PythonTypes.trampoline))) { + if (cha.isSubclassOf(receiver, cha.lookupClass(PythonTypes.trampoline)) || receiver.getReference().equals(PythonTypes.object)) { PythonInvokeInstruction call = (PythonInvokeInstruction) caller.getIR().getCalls(site)[0]; Pair key = Pair.make(receiver, call.getNumberOfTotalParameters()); if (!codeBodies.containsKey(key)) { From b0fad199eea85043ed503cf756e25f153dfc2507 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Mon, 27 Nov 2023 13:29:54 -0500 Subject: [PATCH 02/27] Progress. --- .../python/client/PytestAnalysisEngine.java | 10 ---- .../python/client/PythonAnalysisEngine.java | 13 +++-- .../PythonTrampolineTargetSelector.java | 53 +++++++++++++++++-- 3 files changed, 60 insertions(+), 16 deletions(-) diff --git a/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/client/PytestAnalysisEngine.java b/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/client/PytestAnalysisEngine.java index 765e0b4d0..49bdea156 100644 --- a/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/client/PytestAnalysisEngine.java +++ b/com.ibm.wala.cast.python.jython3/source/com/ibm/wala/cast/python/client/PytestAnalysisEngine.java @@ -1,6 +1,5 @@ package com.ibm.wala.cast.python.client; -import com.ibm.wala.cast.python.ipa.callgraph.PythonSSAPropagationCallGraphBuilder; import com.ibm.wala.cast.python.loader.PytestLoader; import com.ibm.wala.cast.python.loader.PytestLoaderFactory; import com.ibm.wala.classLoader.CallSiteReference; @@ -10,7 +9,6 @@ import com.ibm.wala.core.util.strings.Atom; import com.ibm.wala.ipa.callgraph.AnalysisOptions; import com.ibm.wala.ipa.callgraph.CGNode; -import com.ibm.wala.ipa.callgraph.IAnalysisCacheView; import com.ibm.wala.ipa.callgraph.MethodTargetSelector; import com.ibm.wala.ipa.callgraph.propagation.InstanceKey; import com.ibm.wala.ipa.callgraph.propagation.PointerKey; @@ -23,8 +21,6 @@ public class PytestAnalysisEngine extends PythonAnalysisEngine { - private PythonSSAPropagationCallGraphBuilder builder; - private class PytestTargetSelector implements MethodTargetSelector { private final MethodTargetSelector base; @@ -88,12 +84,6 @@ protected void addBypassLogic(IClassHierarchy cha, AnalysisOptions options) { addSummaryBypassLogic(options, "pytest.xml"); } - @Override - protected PythonSSAPropagationCallGraphBuilder getCallGraphBuilder( - IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache) { - return builder = super.getCallGraphBuilder(cha, options, cache); - } - @Override public T performAnalysis(PropagationCallGraphBuilder arg0) throws CancelException { return null; diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/client/PythonAnalysisEngine.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/client/PythonAnalysisEngine.java index 574951c41..5da40bfb5 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/client/PythonAnalysisEngine.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/client/PythonAnalysisEngine.java @@ -73,6 +73,8 @@ public abstract class PythonAnalysisEngine private static final Logger logger = Logger.getLogger(PythonAnalysisEngine.class.getName()); + protected PythonSSAPropagationCallGraphBuilder builder; + static { try { Class j3 = Class.forName("com.ibm.wala.cast.python.loader.Python3LoaderFactory"); @@ -286,9 +288,10 @@ public boolean isReferenceType() { protected void addBypassLogic(IClassHierarchy cha, AnalysisOptions options) { options.setSelector( - new PythonTrampolineTargetSelector( + new PythonTrampolineTargetSelector( new PythonConstructorTargetSelector( - new PythonComprehensionTrampolines(options.getMethodTargetSelector())))); + new PythonComprehensionTrampolines(options.getMethodTargetSelector())), + this)); BuiltinFunctions builtins = new BuiltinFunctions(cha); options.setSelector(builtins.builtinClassTargetSelector(options.getClassTargetSelector())); @@ -349,7 +352,11 @@ public int getDefaultValue(SymbolTable symtab, int valueNumber) { new PythonSuper(cha).handleSuperCalls(builder, options); - return builder; + return this.builder = builder; + } + + public PythonSSAPropagationCallGraphBuilder getCachedCallGraphBuilder() { + return this.builder; } protected PythonSSAPropagationCallGraphBuilder makeBuilder( diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java index d927453ff..f13b8dc30 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java @@ -11,6 +11,7 @@ package com.ibm.wala.cast.python.ipa.callgraph; import com.ibm.wala.cast.loader.DynamicCallSiteReference; +import com.ibm.wala.cast.python.client.PythonAnalysisEngine; import com.ibm.wala.cast.python.ipa.summaries.PythonInstanceMethodTrampoline; import com.ibm.wala.cast.python.ipa.summaries.PythonSummarizedFunction; import com.ibm.wala.cast.python.ipa.summaries.PythonSummary; @@ -24,19 +25,30 @@ import com.ibm.wala.core.util.strings.Atom; import com.ibm.wala.ipa.callgraph.CGNode; import com.ibm.wala.ipa.callgraph.MethodTargetSelector; +import com.ibm.wala.ipa.callgraph.propagation.InstanceKey; +import com.ibm.wala.ipa.callgraph.propagation.NormalAllocationInNode; +import com.ibm.wala.ipa.callgraph.propagation.PointerKey; +import com.ibm.wala.ipa.callgraph.propagation.PointerKeyFactory; import com.ibm.wala.ipa.cha.IClassHierarchy; import com.ibm.wala.ssa.SSAReturnInstruction; +import com.ibm.wala.types.ClassLoaderReference; import com.ibm.wala.types.FieldReference; import com.ibm.wala.types.MethodReference; +import com.ibm.wala.types.TypeReference; import com.ibm.wala.util.collections.HashMapFactory; import com.ibm.wala.util.collections.Pair; +import com.ibm.wala.util.intset.OrdinalSet; import java.util.Map; -public class PythonTrampolineTargetSelector implements MethodTargetSelector { +public class PythonTrampolineTargetSelector implements MethodTargetSelector { private final MethodTargetSelector base; - public PythonTrampolineTargetSelector(MethodTargetSelector base) { + private PythonAnalysisEngine engine; + + public PythonTrampolineTargetSelector( + MethodTargetSelector base, PythonAnalysisEngine pythonAnalysisEngine) { this.base = base; + this.engine = pythonAnalysisEngine; } private final Map, IMethod> codeBodies = HashMapFactory.make(); @@ -46,8 +58,17 @@ public PythonTrampolineTargetSelector(MethodTargetSelector base) { public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) { if (receiver != null) { IClassHierarchy cha = receiver.getClassHierarchy(); - if (cha.isSubclassOf(receiver, cha.lookupClass(PythonTypes.trampoline)) || receiver.getReference().equals(PythonTypes.object)) { + if (cha.isSubclassOf(receiver, cha.lookupClass(PythonTypes.trampoline)) + || receiver.getReference().equals(PythonTypes.object)) { PythonInvokeInstruction call = (PythonInvokeInstruction) caller.getIR().getCalls(site)[0]; + + if (receiver.getReference().equals(PythonTypes.object)) { + // It's a callable. Change the receiver. + receiver = getCallable(caller, cha, call); + + if (receiver == null) return null; // not found. + } + Pair key = Pair.make(receiver, call.getNumberOfTotalParameters()); if (!codeBodies.containsKey(key)) { Map names = HashMapFactory.make(); @@ -122,4 +143,30 @@ public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass rec return base.getCalleeTarget(caller, site, receiver); } + + private IClass getCallable(CGNode caller, IClassHierarchy cha, PythonInvokeInstruction call) { + PythonSSAPropagationCallGraphBuilder builder = this.getEngine().getCachedCallGraphBuilder(); + + // Look up the __call__ method. + PointerKeyFactory pkf = builder.getPointerKeyFactory(); + PointerKey test = pkf.getPointerKeyForLocal(caller, call.getUse(0)); + OrdinalSet testObjs = builder.getPointerAnalysis().getPointsToSet(test); + for (InstanceKey o : testObjs) { + NormalAllocationInNode instanceKey = (NormalAllocationInNode) o; + CGNode node = instanceKey.getNode(); + IMethod method = node.getMethod(); + IClass declaringClass = method.getDeclaringClass(); + ClassLoaderReference classLoaderReference = declaringClass.getClassLoader().getReference(); + TypeReference typeReference = + TypeReference.findOrCreateClass( + classLoaderReference, "$script tf2_test_model_call.py/SequentialModel", "__call__"); + return cha.lookupClass(typeReference); + } + + return null; + } + + public PythonAnalysisEngine getEngine() { + return engine; + } } From ece65d0fa7ef46aae11346a9095373583393109b Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Mon, 27 Nov 2023 14:09:02 -0500 Subject: [PATCH 03/27] Metadata. --- .../TestTensorflowModel.testTf2.launch | 1 + 1 file changed, 1 insertion(+) diff --git a/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch b/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch index 336fd1b97..f1fdc94f7 100644 --- a/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch +++ b/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch @@ -18,6 +18,7 @@ + From e4130c7209656f46eb025a7b43ff1b940ea1bee8 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Mon, 27 Nov 2023 14:59:56 -0500 Subject: [PATCH 04/27] Generalize. --- .../callgraph/PythonTrampolineTargetSelector.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java index f13b8dc30..94002e00f 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java @@ -31,9 +31,9 @@ import com.ibm.wala.ipa.callgraph.propagation.PointerKeyFactory; import com.ibm.wala.ipa.cha.IClassHierarchy; import com.ibm.wala.ssa.SSAReturnInstruction; -import com.ibm.wala.types.ClassLoaderReference; import com.ibm.wala.types.FieldReference; import com.ibm.wala.types.MethodReference; +import com.ibm.wala.types.TypeName; import com.ibm.wala.types.TypeReference; import com.ibm.wala.util.collections.HashMapFactory; import com.ibm.wala.util.collections.Pair; @@ -147,19 +147,20 @@ public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass rec private IClass getCallable(CGNode caller, IClassHierarchy cha, PythonInvokeInstruction call) { PythonSSAPropagationCallGraphBuilder builder = this.getEngine().getCachedCallGraphBuilder(); - // Look up the __call__ method. + // Lookup the __call__ method. PointerKeyFactory pkf = builder.getPointerKeyFactory(); - PointerKey test = pkf.getPointerKeyForLocal(caller, call.getUse(0)); - OrdinalSet testObjs = builder.getPointerAnalysis().getPointsToSet(test); - for (InstanceKey o : testObjs) { + PointerKey receiver = pkf.getPointerKeyForLocal(caller, call.getUse(0)); + OrdinalSet objs = builder.getPointerAnalysis().getPointsToSet(receiver); + for (InstanceKey o : objs) { NormalAllocationInNode instanceKey = (NormalAllocationInNode) o; CGNode node = instanceKey.getNode(); IMethod method = node.getMethod(); IClass declaringClass = method.getDeclaringClass(); - ClassLoaderReference classLoaderReference = declaringClass.getClassLoader().getReference(); + TypeName declaringClassName = declaringClass.getName(); + String packageName = "$" + declaringClassName.toString().substring(1); TypeReference typeReference = TypeReference.findOrCreateClass( - classLoaderReference, "$script tf2_test_model_call.py/SequentialModel", "__call__"); + declaringClass.getClassLoader().getReference(), packageName, "__call__"); return cha.lookupClass(typeReference); } From d591bc48cd015c2a9c4fadcc9011e23c00a5680c Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Mon, 27 Nov 2023 15:01:58 -0500 Subject: [PATCH 05/27] More readable. --- .../ipa/callgraph/PythonTrampolineTargetSelector.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java index 94002e00f..bcb1a1583 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java @@ -58,11 +58,12 @@ public PythonTrampolineTargetSelector( public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) { if (receiver != null) { IClassHierarchy cha = receiver.getClassHierarchy(); - if (cha.isSubclassOf(receiver, cha.lookupClass(PythonTypes.trampoline)) - || receiver.getReference().equals(PythonTypes.object)) { + final boolean isCallable = receiver.getReference().equals(PythonTypes.object); + + if (cha.isSubclassOf(receiver, cha.lookupClass(PythonTypes.trampoline)) || isCallable) { PythonInvokeInstruction call = (PythonInvokeInstruction) caller.getIR().getCalls(site)[0]; - if (receiver.getReference().equals(PythonTypes.object)) { + if (isCallable) { // It's a callable. Change the receiver. receiver = getCallable(caller, cha, call); From ebf456bb6e991830034fbea27ecff3d0f76b3434 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Mon, 27 Nov 2023 15:15:58 -0500 Subject: [PATCH 06/27] Add constant. --- .../python/ipa/callgraph/PythonTrampolineTargetSelector.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java index bcb1a1583..8cdabda86 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java @@ -41,6 +41,8 @@ import java.util.Map; public class PythonTrampolineTargetSelector implements MethodTargetSelector { + private static final String CALL = "__call__"; + private final MethodTargetSelector base; private PythonAnalysisEngine engine; @@ -161,7 +163,7 @@ private IClass getCallable(CGNode caller, IClassHierarchy cha, PythonInvokeInstr String packageName = "$" + declaringClassName.toString().substring(1); TypeReference typeReference = TypeReference.findOrCreateClass( - declaringClass.getClassLoader().getReference(), packageName, "__call__"); + declaringClass.getClassLoader().getReference(), packageName, CALL); return cha.lookupClass(typeReference); } From 573cfa1ed7ee7888ce407be8d9ae21d53085215b Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Mon, 27 Nov 2023 15:16:08 -0500 Subject: [PATCH 07/27] Add final. --- .../python/ipa/callgraph/PythonTrampolineTargetSelector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java index 8cdabda86..e3f944159 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java @@ -160,7 +160,7 @@ private IClass getCallable(CGNode caller, IClassHierarchy cha, PythonInvokeInstr IMethod method = node.getMethod(); IClass declaringClass = method.getDeclaringClass(); TypeName declaringClassName = declaringClass.getName(); - String packageName = "$" + declaringClassName.toString().substring(1); + final String packageName = "$" + declaringClassName.toString().substring(1); TypeReference typeReference = TypeReference.findOrCreateClass( declaringClass.getClassLoader().getReference(), packageName, CALL); From 05f932008ce48df288797b02f758624e38257bf6 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Tue, 28 Nov 2023 15:07:29 -0500 Subject: [PATCH 08/27] Shorten variable name. --- .../ipa/callgraph/PythonTrampolineTargetSelector.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java index e3f944159..0e6d4ce18 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java @@ -60,12 +60,12 @@ public PythonTrampolineTargetSelector( public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) { if (receiver != null) { IClassHierarchy cha = receiver.getClassHierarchy(); - final boolean isCallable = receiver.getReference().equals(PythonTypes.object); + final boolean callable = receiver.getReference().equals(PythonTypes.object); - if (cha.isSubclassOf(receiver, cha.lookupClass(PythonTypes.trampoline)) || isCallable) { + if (cha.isSubclassOf(receiver, cha.lookupClass(PythonTypes.trampoline)) || callable) { PythonInvokeInstruction call = (PythonInvokeInstruction) caller.getIR().getCalls(site)[0]; - if (isCallable) { + if (callable) { // It's a callable. Change the receiver. receiver = getCallable(caller, cha, call); From 549d88e48640ad48fcb90216244a3cf719db51e5 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Wed, 29 Nov 2023 14:37:01 -0500 Subject: [PATCH 09/27] Keep going if the class isn't found. --- .../ipa/callgraph/PythonTrampolineTargetSelector.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java index 0e6d4ce18..aaeda951b 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java @@ -154,6 +154,7 @@ private IClass getCallable(CGNode caller, IClassHierarchy cha, PythonInvokeInstr PointerKeyFactory pkf = builder.getPointerKeyFactory(); PointerKey receiver = pkf.getPointerKeyForLocal(caller, call.getUse(0)); OrdinalSet objs = builder.getPointerAnalysis().getPointsToSet(receiver); + for (InstanceKey o : objs) { NormalAllocationInNode instanceKey = (NormalAllocationInNode) o; CGNode node = instanceKey.getNode(); @@ -164,7 +165,10 @@ private IClass getCallable(CGNode caller, IClassHierarchy cha, PythonInvokeInstr TypeReference typeReference = TypeReference.findOrCreateClass( declaringClass.getClassLoader().getReference(), packageName, CALL); - return cha.lookupClass(typeReference); + IClass lookupClass = cha.lookupClass(typeReference); + + if (lookupClass != null) + return lookupClass; } return null; From 4cb419b797bc54ce1087b177e60ed2a2b87fc01b Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Wed, 29 Nov 2023 14:37:29 -0500 Subject: [PATCH 10/27] Turn verbose logging on. --- .../TestTensorflowModel.testTf2.launch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch b/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch index f1fdc94f7..1043bf98f 100644 --- a/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch +++ b/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch @@ -25,5 +25,5 @@ - + From 508ddb5c119fb6269ef1ff9f6c937f26fd702b7b Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Wed, 29 Nov 2023 17:39:59 -0500 Subject: [PATCH 11/27] Progress. --- .../python/ml/test/TestTensorflowModel.java | 11 ++-- .../PythonSSAPropagationCallGraphBuilder.java | 50 ++++++++++++++++++- .../PythonTrampolineTargetSelector.java | 7 ++- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java index 7738657c2..792554b38 100644 --- a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java +++ b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java @@ -207,20 +207,15 @@ public void testTf2() testTf2("tf2_test_tensor_list.py", "add", 2, 3, 2, 3); testTf2("tf2_test_tensor_list2.py", "add", 0, 2); testTf2("tf2_test_tensor_list3.py", "add", 0, 2); - testTf2( - "tf2_test_model_call.py", - "SequentialModel.__call__", - 0, - 2); // NOTE: Change to testTf2("tf2_test_model_call.py", "SequentialModel.__call__", 1, 4, - // 2) once - // https://github.com/wala/ML/issues/24 is fixed. + testTf2("tf2_test_model_call.py", "SequentialModel.__call__", 1, 4, 2); testTf2( "tf2_test_model_call2.py", "SequentialModel.call", 0, 2); // NOTE: Change to testTf2("tf2_test_model_call2.py", "SequentialModel.call", 1, 4, 2) // once - // https://github.com/wala/ML/issues/24 is fixed. + // https://github.com/wala/ML/issues/24 is fixed. TODO: We actually need a different issue for + // this. testTf2("tf2_test_model_call3.py", "SequentialModel.call", 1, 4, 2); testTf2("tf2_test_model_call4.py", "SequentialModel.__call__", 1, 4, 2); } diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonSSAPropagationCallGraphBuilder.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonSSAPropagationCallGraphBuilder.java index 7629a9879..ec1899321 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonSSAPropagationCallGraphBuilder.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonSSAPropagationCallGraphBuilder.java @@ -17,6 +17,7 @@ import com.ibm.wala.cast.python.ssa.PythonInstructionVisitor; import com.ibm.wala.cast.python.ssa.PythonInvokeInstruction; import com.ibm.wala.cast.python.types.PythonTypes; +import com.ibm.wala.classLoader.IClass; import com.ibm.wala.classLoader.IField; import com.ibm.wala.core.util.strings.Atom; import com.ibm.wala.fixpoint.AbstractOperator; @@ -25,6 +26,7 @@ import com.ibm.wala.ipa.callgraph.IAnalysisCacheView; import com.ibm.wala.ipa.callgraph.propagation.AbstractFieldPointerKey; import com.ibm.wala.ipa.callgraph.propagation.InstanceKey; +import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis; import com.ibm.wala.ipa.callgraph.propagation.PointerKey; import com.ibm.wala.ipa.callgraph.propagation.PointerKeyFactory; import com.ibm.wala.ipa.callgraph.propagation.PointsToSetVariable; @@ -40,10 +42,14 @@ import com.ibm.wala.types.TypeReference; import com.ibm.wala.util.collections.HashMapFactory; import com.ibm.wala.util.collections.Pair; +import com.ibm.wala.util.intset.IntIterator; +import com.ibm.wala.util.intset.IntSet; import com.ibm.wala.util.intset.IntSetUtil; import com.ibm.wala.util.intset.MutableIntSet; +import com.ibm.wala.util.intset.OrdinalSet; import java.util.Arrays; import java.util.Collection; +import java.util.Iterator; import java.util.Map; public class PythonSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraphBuilder { @@ -211,7 +217,34 @@ protected void processCallingConstraints( } } else { PointerKey rval = getPointerKeyForLocal(caller, call.getUse(i)); - getSystem().newConstraint(lval, assignOperator, rval); + + // If we are looking at the implicit parameter of a callable. + if (call.getCallSite().isDispatch() && i == 0 && isCallable(rval)) { + for (Iterator it = this.getSystem().iteratePointerKeys(); it.hasNext(); ) { + PointerKey pointerKey = it.next(); + System.out.println(pointerKey); + } + + TypeReference typeReference = + TypeReference.findOrCreate( + caller.getMethod().getDeclaringClass().getClassLoader().getReference(), + "L$script tf2_test_model_call.py/SequentialModel/__call__"); + System.out.println(typeReference); + IClass lookupClass = this.getClassHierarchy().lookupClass(typeReference); + System.out.println(lookupClass); + + IntSet instanceKeysForClass = this.getSystem().getInstanceKeysForClass(lookupClass); + System.out.println(instanceKeysForClass); + + for (IntIterator it = instanceKeysForClass.intIterator(); it.hasNext(); ) { + int instanceKeyIndex = it.next(); + System.out.println(instanceKeyIndex); + InstanceKey instanceKey = this.getSystem().getInstanceKey(instanceKeyIndex); + System.out.println(instanceKey); + + this.getSystem().newConstraint(lval, instanceKey); + } + } else getSystem().newConstraint(lval, assignOperator, rval); } } @@ -271,6 +304,21 @@ protected void processCallingConstraints( } } + protected boolean isCallable(PointerKey rval) { + PointerAnalysis pointerAnalysis = this.getPointerAnalysis(); + OrdinalSet pointsToSet = pointerAnalysis.getPointsToSet(rval); + + for (InstanceKey instanceKey : pointsToSet) { + IClass concreteType = instanceKey.getConcreteType(); + TypeReference reference = concreteType.getReference(); + + // If it's an "object" method. + if (reference.equals(PythonTypes.object)) return true; + } + + return false; + } + @Override public PythonConstraintVisitor makeVisitor(CGNode node) { return new PythonConstraintVisitor(this, node); diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java index aaeda951b..20108293d 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonTrampolineTargetSelector.java @@ -154,7 +154,7 @@ private IClass getCallable(CGNode caller, IClassHierarchy cha, PythonInvokeInstr PointerKeyFactory pkf = builder.getPointerKeyFactory(); PointerKey receiver = pkf.getPointerKeyForLocal(caller, call.getUse(0)); OrdinalSet objs = builder.getPointerAnalysis().getPointsToSet(receiver); - + for (InstanceKey o : objs) { NormalAllocationInNode instanceKey = (NormalAllocationInNode) o; CGNode node = instanceKey.getNode(); @@ -166,9 +166,8 @@ private IClass getCallable(CGNode caller, IClassHierarchy cha, PythonInvokeInstr TypeReference.findOrCreateClass( declaringClass.getClassLoader().getReference(), packageName, CALL); IClass lookupClass = cha.lookupClass(typeReference); - - if (lookupClass != null) - return lookupClass; + + if (lookupClass != null) return lookupClass; } return null; From ecaa646a03a040488f2ef192c3e5cd8c962e1c28 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 09:46:59 -0500 Subject: [PATCH 12/27] Address https://github.com/wala/ML/issues/106#issuecomment-1833055433. --- .../com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java index 792554b38..0efaa55ff 100644 --- a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java +++ b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java @@ -213,9 +213,7 @@ public void testTf2() "SequentialModel.call", 0, 2); // NOTE: Change to testTf2("tf2_test_model_call2.py", "SequentialModel.call", 1, 4, 2) - // once - // https://github.com/wala/ML/issues/24 is fixed. TODO: We actually need a different issue for - // this. + // once https://github.com/wala/ML/issues/106 is fixed. testTf2("tf2_test_model_call3.py", "SequentialModel.call", 1, 4, 2); testTf2("tf2_test_model_call4.py", "SequentialModel.__call__", 1, 4, 2); } From f0f767937a648457ab9944646a3f4cb630cf0042 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 10:39:39 -0500 Subject: [PATCH 13/27] Remove hardcoding and cleanup. --- .../PythonSSAPropagationCallGraphBuilder.java | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonSSAPropagationCallGraphBuilder.java b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonSSAPropagationCallGraphBuilder.java index ec1899321..5e80fcd22 100644 --- a/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonSSAPropagationCallGraphBuilder.java +++ b/com.ibm.wala.cast.python/source/com/ibm/wala/cast/python/ipa/callgraph/PythonSSAPropagationCallGraphBuilder.java @@ -19,6 +19,7 @@ import com.ibm.wala.cast.python.types.PythonTypes; import com.ibm.wala.classLoader.IClass; import com.ibm.wala.classLoader.IField; +import com.ibm.wala.classLoader.IMethod; import com.ibm.wala.core.util.strings.Atom; import com.ibm.wala.fixpoint.AbstractOperator; import com.ibm.wala.ipa.callgraph.AnalysisOptions; @@ -39,6 +40,7 @@ import com.ibm.wala.ssa.SSAGetInstruction; import com.ibm.wala.ssa.SymbolTable; import com.ibm.wala.types.FieldReference; +import com.ibm.wala.types.TypeName; import com.ibm.wala.types.TypeReference; import com.ibm.wala.util.collections.HashMapFactory; import com.ibm.wala.util.collections.Pair; @@ -49,7 +51,6 @@ import com.ibm.wala.util.intset.OrdinalSet; import java.util.Arrays; import java.util.Collection; -import java.util.Iterator; import java.util.Map; public class PythonSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraphBuilder { @@ -220,28 +221,13 @@ protected void processCallingConstraints( // If we are looking at the implicit parameter of a callable. if (call.getCallSite().isDispatch() && i == 0 && isCallable(rval)) { - for (Iterator it = this.getSystem().iteratePointerKeys(); it.hasNext(); ) { - PointerKey pointerKey = it.next(); - System.out.println(pointerKey); - } - - TypeReference typeReference = - TypeReference.findOrCreate( - caller.getMethod().getDeclaringClass().getClassLoader().getReference(), - "L$script tf2_test_model_call.py/SequentialModel/__call__"); - System.out.println(typeReference); - IClass lookupClass = this.getClassHierarchy().lookupClass(typeReference); - System.out.println(lookupClass); + // Ensure that lval's variable refers to the callable method instead of callable object. + IClass callable = getCallable(target); + IntSet instanceKeysForCallable = this.getSystem().getInstanceKeysForClass(callable); - IntSet instanceKeysForClass = this.getSystem().getInstanceKeysForClass(lookupClass); - System.out.println(instanceKeysForClass); - - for (IntIterator it = instanceKeysForClass.intIterator(); it.hasNext(); ) { + for (IntIterator it = instanceKeysForCallable.intIterator(); it.hasNext(); ) { int instanceKeyIndex = it.next(); - System.out.println(instanceKeyIndex); InstanceKey instanceKey = this.getSystem().getInstanceKey(instanceKeyIndex); - System.out.println(instanceKey); - this.getSystem().newConstraint(lval, instanceKey); } } else getSystem().newConstraint(lval, assignOperator, rval); @@ -304,6 +290,18 @@ protected void processCallingConstraints( } } + private IClass getCallable(CGNode target) { + IMethod method = target.getMethod(); + IClass declaringClass = method.getDeclaringClass(); + TypeName declaringClassName = declaringClass.getName(); + + TypeReference typeReference = + TypeReference.findOrCreate( + declaringClass.getClassLoader().getReference(), declaringClassName); + + return this.getClassHierarchy().lookupClass(typeReference); + } + protected boolean isCallable(PointerKey rval) { PointerAnalysis pointerAnalysis = this.getPointerAnalysis(); OrdinalSet pointsToSet = pointerAnalysis.getPointsToSet(rval); From 7062aac270d68da77d14bba57d862617c0202a53 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 11:02:34 -0500 Subject: [PATCH 14/27] Add another calls test. Like calls1 but replace Foo.foo with Foo.__call__. --- com.ibm.wala.cast.python.test/data/calls9.py | 57 +++++++++++++++++++ .../ibm/wala/cast/python/test/TestCalls.java | 29 ++++++++++ 2 files changed, 86 insertions(+) create mode 100644 com.ibm.wala.cast.python.test/data/calls9.py diff --git a/com.ibm.wala.cast.python.test/data/calls9.py b/com.ibm.wala.cast.python.test/data/calls9.py new file mode 100644 index 000000000..fa6b1f2e0 --- /dev/null +++ b/com.ibm.wala.cast.python.test/data/calls9.py @@ -0,0 +1,57 @@ +base_init = 10 + +def id(x): + return x + +def call(x, y): + return x(y) + +def foo(a,b): + return call(id, a+b) + +class Foo(object): + base = base_init + + def __call__(self, a, b): + self.contents = id(a+b+self.base) + return self.contents + +print(Foo) + +print(Foo.__call__) +print(Foo.base) + +print(foo) +print(foo(1,2)) + +instance = Foo() +print(Foo.__call__(instance, 2,3)) +print(instance.__call__(2,3)) + +f = instance.__call__ +print(f); +print(f(3,4)) + +instance.f = foo +print(instance.f(4,5)) +print(instance.f); + +instance.__call__ = foo; +print(instance.__call__(5,6)) +print(instance.__call__); + +foo.x = foo; +print(foo.x(6,7)); +print(foo.x); + +x = Foo +print(x) +y = x() +print(y) +print(y.__call__(7,8)) + +def nothing(): + return 0 + +z = id(nothing) +z() diff --git a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCalls.java b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCalls.java index f754561bd..59aca9e8c 100644 --- a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCalls.java +++ b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCalls.java @@ -194,6 +194,35 @@ public Void performAnalysis(PropagationCallGraphBuilder builder) throws CancelEx CG); } + protected static final Object[][] assertionsCalls9 = + new Object[][] { + new Object[] {ROOT, new String[] {"script calls9.py"}}, + new Object[] { + "script calls9.py", + new String[] { + "script calls9.py/Foo", + "script calls9.py/foo", + "$script calls9.py/Foo/__call__:trampoline3", + "script calls9.py/id", + "script calls9.py/nothing" + } + }, + new Object[] { + "$script calls9.py/Foo/__call__:trampoline3", + new String[] {"script calls9.py/Foo/__call__"} + }, + new Object[] {"script calls9.py/call", new String[] {"script calls9.py/id"}}, + new Object[] {"script calls9.py/Foo/__call__", new String[] {"script calls9.py/id"}}, + new Object[] {"script calls9.py/foo", new String[] {"script calls9.py/call"}} + }; + + @Test + public void testCalls9() + throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { + CallGraph CG = process("calls9.py"); + verifyGraphAssertions(CG, assertionsCalls9); + } + protected static final Object[][] assertionsDefaultValues = new Object[][] { new Object[] {ROOT, new String[] {"script defaultValuesTest.py"}}, From ff005ed0260efdc917016b90a74772e3f9a3b633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatiana=20Castro-V=C3=A9lez?= Date: Thu, 30 Nov 2023 11:30:42 -0500 Subject: [PATCH 15/27] Changing issue for test --- .../com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java index 7738657c2..bef0ac9bb 100644 --- a/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java +++ b/com.ibm.wala.cast.python.ml.test/source/com/ibm/wala/cast/python/ml/test/TestTensorflowModel.java @@ -220,7 +220,7 @@ public void testTf2() 0, 2); // NOTE: Change to testTf2("tf2_test_model_call2.py", "SequentialModel.call", 1, 4, 2) // once - // https://github.com/wala/ML/issues/24 is fixed. + // https://github.com/wala/ML/issues/106 is fixed. testTf2("tf2_test_model_call3.py", "SequentialModel.call", 1, 4, 2); testTf2("tf2_test_model_call4.py", "SequentialModel.__call__", 1, 4, 2); } From 39e77864358aac52a3af06afb8013253cdc6be47 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 12:17:57 -0500 Subject: [PATCH 16/27] Add callables test. --- .../data/callables.py | 9 +++ .../data/callables2.py | 9 +++ .../wala/cast/python/test/TestCallables.java | 56 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 com.ibm.wala.cast.python.test/data/callables.py create mode 100644 com.ibm.wala.cast.python.test/data/callables2.py create mode 100644 com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java diff --git a/com.ibm.wala.cast.python.test/data/callables.py b/com.ibm.wala.cast.python.test/data/callables.py new file mode 100644 index 000000000..de9c08e1b --- /dev/null +++ b/com.ibm.wala.cast.python.test/data/callables.py @@ -0,0 +1,9 @@ +class C: + + def __call__(self, x): + return x * x + + +c = C() +a = c.__call__(5) +assert a == 25 diff --git a/com.ibm.wala.cast.python.test/data/callables2.py b/com.ibm.wala.cast.python.test/data/callables2.py new file mode 100644 index 000000000..56b017789 --- /dev/null +++ b/com.ibm.wala.cast.python.test/data/callables2.py @@ -0,0 +1,9 @@ +class C: + + def __call__(self, x): + return x * x + + +c = C() +a = c(5) +assert a == 25 diff --git a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java new file mode 100644 index 000000000..b5aff620d --- /dev/null +++ b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java @@ -0,0 +1,56 @@ +package com.ibm.wala.cast.python.test; + +import static org.junit.Assert.assertTrue; + +import com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil; +import com.ibm.wala.cast.python.client.PythonAnalysisEngine; +import com.ibm.wala.cast.python.ipa.callgraph.PythonSSAPropagationCallGraphBuilder; +import com.ibm.wala.ipa.callgraph.CGNode; +import com.ibm.wala.ipa.callgraph.CallGraph; +import com.ibm.wala.ipa.callgraph.propagation.SSAContextInterpreter; +import com.ibm.wala.ipa.cha.ClassHierarchyException; +import com.ibm.wala.util.CancelException; +import java.io.IOException; +import java.util.Iterator; +import org.junit.Test; + +public class TestCallables extends TestPythonCallGraphShape { + + @Test + public void testCallables() + throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { + final String[] testFileNames = {"callables.py", "callables2.py"}; + + for (String fileName : testFileNames) { + PythonAnalysisEngine E = makeEngine(fileName); + PythonSSAPropagationCallGraphBuilder B = E.defaultCallGraphBuilder(); + CallGraph CG = B.makeCallGraph(B.getOptions()); + + CAstCallGraphUtil.AVOID_DUMP = false; + CAstCallGraphUtil.dumpCG( + (SSAContextInterpreter) B.getContextInterpreter(), B.getPointerAnalysis(), CG); + + boolean found = false; + + for (CGNode node : CG) { + if (node.getMethod() + .getDeclaringClass() + .getName() + .toString() + .equals("Lscript " + fileName)) { + for (Iterator it = CG.getSuccNodes(node); it.hasNext(); ) { + CGNode callee = it.next(); + if (callee + .getMethod() + .getDeclaringClass() + .getName() + .toString() + .equals("L$script " + fileName + "/C/__call__")) found = true; + } + } + } + + assertTrue("Expecting to find __call__ method trampoline in: " + fileName + ".", found); + } + } +} From c577453d3c92e9e5adb1cd2db81bcf62e6c5cfc2 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 12:18:49 -0500 Subject: [PATCH 17/27] Revert "Add another calls test." This reverts commit 7062aac270d68da77d14bba57d862617c0202a53. It's not testing what we want. --- com.ibm.wala.cast.python.test/data/calls9.py | 57 ------------------- .../ibm/wala/cast/python/test/TestCalls.java | 29 ---------- 2 files changed, 86 deletions(-) delete mode 100644 com.ibm.wala.cast.python.test/data/calls9.py diff --git a/com.ibm.wala.cast.python.test/data/calls9.py b/com.ibm.wala.cast.python.test/data/calls9.py deleted file mode 100644 index fa6b1f2e0..000000000 --- a/com.ibm.wala.cast.python.test/data/calls9.py +++ /dev/null @@ -1,57 +0,0 @@ -base_init = 10 - -def id(x): - return x - -def call(x, y): - return x(y) - -def foo(a,b): - return call(id, a+b) - -class Foo(object): - base = base_init - - def __call__(self, a, b): - self.contents = id(a+b+self.base) - return self.contents - -print(Foo) - -print(Foo.__call__) -print(Foo.base) - -print(foo) -print(foo(1,2)) - -instance = Foo() -print(Foo.__call__(instance, 2,3)) -print(instance.__call__(2,3)) - -f = instance.__call__ -print(f); -print(f(3,4)) - -instance.f = foo -print(instance.f(4,5)) -print(instance.f); - -instance.__call__ = foo; -print(instance.__call__(5,6)) -print(instance.__call__); - -foo.x = foo; -print(foo.x(6,7)); -print(foo.x); - -x = Foo -print(x) -y = x() -print(y) -print(y.__call__(7,8)) - -def nothing(): - return 0 - -z = id(nothing) -z() diff --git a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCalls.java b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCalls.java index 59aca9e8c..f754561bd 100644 --- a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCalls.java +++ b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCalls.java @@ -194,35 +194,6 @@ public Void performAnalysis(PropagationCallGraphBuilder builder) throws CancelEx CG); } - protected static final Object[][] assertionsCalls9 = - new Object[][] { - new Object[] {ROOT, new String[] {"script calls9.py"}}, - new Object[] { - "script calls9.py", - new String[] { - "script calls9.py/Foo", - "script calls9.py/foo", - "$script calls9.py/Foo/__call__:trampoline3", - "script calls9.py/id", - "script calls9.py/nothing" - } - }, - new Object[] { - "$script calls9.py/Foo/__call__:trampoline3", - new String[] {"script calls9.py/Foo/__call__"} - }, - new Object[] {"script calls9.py/call", new String[] {"script calls9.py/id"}}, - new Object[] {"script calls9.py/Foo/__call__", new String[] {"script calls9.py/id"}}, - new Object[] {"script calls9.py/foo", new String[] {"script calls9.py/call"}} - }; - - @Test - public void testCalls9() - throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - CallGraph CG = process("calls9.py"); - verifyGraphAssertions(CG, assertionsCalls9); - } - protected static final Object[][] assertionsDefaultValues = new Object[][] { new Object[] {ROOT, new String[] {"script defaultValuesTest.py"}}, From 2419b0d9b300ccc4e0e8c7c2ac5bbf9f0e10ecf7 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 12:21:24 -0500 Subject: [PATCH 18/27] Add expliclt super class to callables test. --- com.ibm.wala.cast.python.test/data/callables3.py | 9 +++++++++ com.ibm.wala.cast.python.test/data/callables4.py | 9 +++++++++ .../com/ibm/wala/cast/python/test/TestCallables.java | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 com.ibm.wala.cast.python.test/data/callables3.py create mode 100644 com.ibm.wala.cast.python.test/data/callables4.py diff --git a/com.ibm.wala.cast.python.test/data/callables3.py b/com.ibm.wala.cast.python.test/data/callables3.py new file mode 100644 index 000000000..c64a8d661 --- /dev/null +++ b/com.ibm.wala.cast.python.test/data/callables3.py @@ -0,0 +1,9 @@ +class C(object): + + def __call__(self, x): + return x * x + + +c = C() +a = c.__call__(5) +assert a == 25 diff --git a/com.ibm.wala.cast.python.test/data/callables4.py b/com.ibm.wala.cast.python.test/data/callables4.py new file mode 100644 index 000000000..a37c8548b --- /dev/null +++ b/com.ibm.wala.cast.python.test/data/callables4.py @@ -0,0 +1,9 @@ +class C(object): + + def __call__(self, x): + return x * x + + +c = C() +a = c(5) +assert a == 25 diff --git a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java index b5aff620d..65628414a 100644 --- a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java +++ b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java @@ -19,7 +19,7 @@ public class TestCallables extends TestPythonCallGraphShape { @Test public void testCallables() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - final String[] testFileNames = {"callables.py", "callables2.py"}; + final String[] testFileNames = {"callables.py", "callables2.py", "callables3.py", "callables4.py"}; for (String fileName : testFileNames) { PythonAnalysisEngine E = makeEngine(fileName); From 5a479586f3833952e3f71d863e866bb93f90483d Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 12:24:08 -0500 Subject: [PATCH 19/27] Add user-defined superclass. --- com.ibm.wala.cast.python.test/data/callables5.py | 13 +++++++++++++ com.ibm.wala.cast.python.test/data/callables6.py | 13 +++++++++++++ .../ibm/wala/cast/python/test/TestCallables.java | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 com.ibm.wala.cast.python.test/data/callables5.py create mode 100644 com.ibm.wala.cast.python.test/data/callables6.py diff --git a/com.ibm.wala.cast.python.test/data/callables5.py b/com.ibm.wala.cast.python.test/data/callables5.py new file mode 100644 index 000000000..e29d03592 --- /dev/null +++ b/com.ibm.wala.cast.python.test/data/callables5.py @@ -0,0 +1,13 @@ +class D: + pass + + +class C(D): + + def __call__(self, x): + return x * x + + +c = C() +a = c.__call__(5) +assert a == 25 diff --git a/com.ibm.wala.cast.python.test/data/callables6.py b/com.ibm.wala.cast.python.test/data/callables6.py new file mode 100644 index 000000000..0040d95ec --- /dev/null +++ b/com.ibm.wala.cast.python.test/data/callables6.py @@ -0,0 +1,13 @@ +class D: + pass + + +class C(D): + + def __call__(self, x): + return x * x + + +c = C() +a = c(5) +assert a == 25 diff --git a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java index 65628414a..1af03fdfd 100644 --- a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java +++ b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java @@ -19,7 +19,7 @@ public class TestCallables extends TestPythonCallGraphShape { @Test public void testCallables() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - final String[] testFileNames = {"callables.py", "callables2.py", "callables3.py", "callables4.py"}; + final String[] testFileNames = {"callables.py", "callables2.py", "callables3.py", "callables4.py", "callables5.py", "callables6.py"}; for (String fileName : testFileNames) { PythonAnalysisEngine E = makeEngine(fileName); From 02cfd10b9428c2809d6432402697d5fa469ff146 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 13:15:27 -0500 Subject: [PATCH 20/27] Add logging. --- .../com/ibm/wala/cast/python/test/TestCallables.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java index 1af03fdfd..3b76fbee8 100644 --- a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java +++ b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java @@ -2,20 +2,21 @@ import static org.junit.Assert.assertTrue; -import com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil; import com.ibm.wala.cast.python.client.PythonAnalysisEngine; import com.ibm.wala.cast.python.ipa.callgraph.PythonSSAPropagationCallGraphBuilder; import com.ibm.wala.ipa.callgraph.CGNode; import com.ibm.wala.ipa.callgraph.CallGraph; -import com.ibm.wala.ipa.callgraph.propagation.SSAContextInterpreter; import com.ibm.wala.ipa.cha.ClassHierarchyException; import com.ibm.wala.util.CancelException; import java.io.IOException; import java.util.Iterator; +import java.util.logging.Logger; import org.junit.Test; public class TestCallables extends TestPythonCallGraphShape { + private static Logger logger = Logger.getLogger(TestCallables.class.getName()); + @Test public void testCallables() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { @@ -38,8 +39,12 @@ public void testCallables() .getName() .toString() .equals("Lscript " + fileName)) { + for (Iterator it = CG.getSuccNodes(node); it.hasNext(); ) { CGNode callee = it.next(); + + logger.info("Found callee: " + callee.getMethod().getSignature()); + if (callee .getMethod() .getDeclaringClass() From 77aa3006a9ac6ed03881fd06a427c127a64937d8 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 13:15:42 -0500 Subject: [PATCH 21/27] Format. --- .../com/ibm/wala/cast/python/test/TestCallables.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java index 3b76fbee8..e3c656125 100644 --- a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java +++ b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java @@ -20,7 +20,14 @@ public class TestCallables extends TestPythonCallGraphShape { @Test public void testCallables() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { - final String[] testFileNames = {"callables.py", "callables2.py", "callables3.py", "callables4.py", "callables5.py", "callables6.py"}; + final String[] testFileNames = { + "callables.py", + "callables2.py", + "callables3.py", + "callables4.py", + "callables5.py", + "callables6.py" + }; for (String fileName : testFileNames) { PythonAnalysisEngine E = makeEngine(fileName); From 92dd214d9d33a81951657b4883bfcac56bd6b494 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 13:16:37 -0500 Subject: [PATCH 22/27] Remove CG dump. --- .../com/ibm/wala/cast/python/test/TestCallables.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java index e3c656125..17ac6c2c1 100644 --- a/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java +++ b/com.ibm.wala.cast.python.test/source/com/ibm/wala/cast/python/test/TestCallables.java @@ -2,8 +2,6 @@ import static org.junit.Assert.assertTrue; -import com.ibm.wala.cast.python.client.PythonAnalysisEngine; -import com.ibm.wala.cast.python.ipa.callgraph.PythonSSAPropagationCallGraphBuilder; import com.ibm.wala.ipa.callgraph.CGNode; import com.ibm.wala.ipa.callgraph.CallGraph; import com.ibm.wala.ipa.cha.ClassHierarchyException; @@ -30,14 +28,7 @@ public void testCallables() }; for (String fileName : testFileNames) { - PythonAnalysisEngine E = makeEngine(fileName); - PythonSSAPropagationCallGraphBuilder B = E.defaultCallGraphBuilder(); - CallGraph CG = B.makeCallGraph(B.getOptions()); - - CAstCallGraphUtil.AVOID_DUMP = false; - CAstCallGraphUtil.dumpCG( - (SSAContextInterpreter) B.getContextInterpreter(), B.getPointerAnalysis(), CG); - + CallGraph CG = process(fileName); boolean found = false; for (CGNode node : CG) { From af2bf299d7a5e2d43dab02dcd1417746888990a3 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Mon, 27 Nov 2023 14:09:02 -0500 Subject: [PATCH 23/27] Metadata. --- .../TestTensorflowModel.testTf2.launch | 1 + 1 file changed, 1 insertion(+) diff --git a/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch b/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch index 336fd1b97..f1fdc94f7 100644 --- a/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch +++ b/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch @@ -18,6 +18,7 @@ + From 791d0548af93bd05284a0e4382530f9eeb8123bd Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Wed, 29 Nov 2023 14:37:29 -0500 Subject: [PATCH 24/27] Turn verbose logging on. --- .../TestTensorflowModel.testTf2.launch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch b/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch index f1fdc94f7..1043bf98f 100644 --- a/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch +++ b/com.ibm.wala.cast.python.ml.test/TestTensorflowModel.testTf2.launch @@ -25,5 +25,5 @@ - + From bbdd1f9bff4fa0c9d2ee7d7d15d98c267c261361 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 13:33:26 -0500 Subject: [PATCH 25/27] Move CODEOWNERS file. --- .github/{workflows => }/CODEOWNERS | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => }/CODEOWNERS (100%) diff --git a/.github/workflows/CODEOWNERS b/.github/CODEOWNERS similarity index 100% rename from .github/workflows/CODEOWNERS rename to .github/CODEOWNERS From a97eafcea317ac348b42d89aaa319fa2d54bb4d7 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 13:58:38 -0500 Subject: [PATCH 26/27] Prepare for release 0.12.0. --- com.ibm.wala.cast.python.jython.test/pom.xml | 2 +- com.ibm.wala.cast.python.jython/pom.xml | 2 +- com.ibm.wala.cast.python.jython3.test/pom.xml | 2 +- com.ibm.wala.cast.python.jython3/pom.xml | 2 +- com.ibm.wala.cast.python.ml.test/pom.xml | 4 ++-- com.ibm.wala.cast.python.ml/pom.xml | 2 +- com.ibm.wala.cast.python.test/pom.xml | 2 +- com.ibm.wala.cast.python/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/com.ibm.wala.cast.python.jython.test/pom.xml b/com.ibm.wala.cast.python.jython.test/pom.xml index d4687c248..0772d3e1b 100644 --- a/com.ibm.wala.cast.python.jython.test/pom.xml +++ b/com.ibm.wala.cast.python.jython.test/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0-SNAPSHOT + 0.12.0 com.ibm.wala.cast.python.jython.test diff --git a/com.ibm.wala.cast.python.jython/pom.xml b/com.ibm.wala.cast.python.jython/pom.xml index 8cc1626e5..5dfafed18 100644 --- a/com.ibm.wala.cast.python.jython/pom.xml +++ b/com.ibm.wala.cast.python.jython/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0-SNAPSHOT + 0.12.0 com.ibm.wala.cast.python.jython diff --git a/com.ibm.wala.cast.python.jython3.test/pom.xml b/com.ibm.wala.cast.python.jython3.test/pom.xml index ec8e91a10..a7d757189 100644 --- a/com.ibm.wala.cast.python.jython3.test/pom.xml +++ b/com.ibm.wala.cast.python.jython3.test/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0-SNAPSHOT + 0.12.0 com.ibm.wala.cast.python.jython3.test diff --git a/com.ibm.wala.cast.python.jython3/pom.xml b/com.ibm.wala.cast.python.jython3/pom.xml index 21f249bb0..4c0f2e2e5 100644 --- a/com.ibm.wala.cast.python.jython3/pom.xml +++ b/com.ibm.wala.cast.python.jython3/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0-SNAPSHOT + 0.12.0 com.ibm.wala.cast.python.jython3 diff --git a/com.ibm.wala.cast.python.ml.test/pom.xml b/com.ibm.wala.cast.python.ml.test/pom.xml index 4835dd541..e7f35abe5 100644 --- a/com.ibm.wala.cast.python.ml.test/pom.xml +++ b/com.ibm.wala.cast.python.ml.test/pom.xml @@ -4,14 +4,14 @@ com.ibm.wala ml - 0.12.0-SNAPSHOT + 0.12.0 com.ibm.wala.cast.python.ml.test ${project.groupId} com.ibm.wala.cast.python.jython.test - 0.12.0-SNAPSHOT + 0.12.0 ${project.groupId} diff --git a/com.ibm.wala.cast.python.ml/pom.xml b/com.ibm.wala.cast.python.ml/pom.xml index e6c807323..d208c3879 100644 --- a/com.ibm.wala.cast.python.ml/pom.xml +++ b/com.ibm.wala.cast.python.ml/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0-SNAPSHOT + 0.12.0 com.ibm.wala.cast.python.ml diff --git a/com.ibm.wala.cast.python.test/pom.xml b/com.ibm.wala.cast.python.test/pom.xml index 7466402b1..c70f0c3e9 100644 --- a/com.ibm.wala.cast.python.test/pom.xml +++ b/com.ibm.wala.cast.python.test/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0-SNAPSHOT + 0.12.0 com.ibm.wala.cast.python.test diff --git a/com.ibm.wala.cast.python/pom.xml b/com.ibm.wala.cast.python/pom.xml index f1c3dd48a..5c1c5c99d 100644 --- a/com.ibm.wala.cast.python/pom.xml +++ b/com.ibm.wala.cast.python/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0-SNAPSHOT + 0.12.0 com.ibm.wala.cast.python diff --git a/pom.xml b/pom.xml index 47a54fc16..fa2b29389 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.ibm.wala ml - 0.12.0-SNAPSHOT + 0.12.0 pom com.ibm.wala.cast.python From a19235b3bed5735ff0fd21b853b1b46cdedc358c Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Thu, 30 Nov 2023 14:00:24 -0500 Subject: [PATCH 27/27] Prepare next development version. --- com.ibm.wala.cast.python.jython.test/pom.xml | 2 +- com.ibm.wala.cast.python.jython/pom.xml | 2 +- com.ibm.wala.cast.python.jython3.test/pom.xml | 2 +- com.ibm.wala.cast.python.jython3/pom.xml | 2 +- com.ibm.wala.cast.python.ml.test/pom.xml | 4 ++-- com.ibm.wala.cast.python.ml/pom.xml | 2 +- com.ibm.wala.cast.python.test/pom.xml | 2 +- com.ibm.wala.cast.python/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/com.ibm.wala.cast.python.jython.test/pom.xml b/com.ibm.wala.cast.python.jython.test/pom.xml index 0772d3e1b..d0fc900ed 100644 --- a/com.ibm.wala.cast.python.jython.test/pom.xml +++ b/com.ibm.wala.cast.python.jython.test/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0 + 0.13.0-SNAPSHOT com.ibm.wala.cast.python.jython.test diff --git a/com.ibm.wala.cast.python.jython/pom.xml b/com.ibm.wala.cast.python.jython/pom.xml index 5dfafed18..e5980558b 100644 --- a/com.ibm.wala.cast.python.jython/pom.xml +++ b/com.ibm.wala.cast.python.jython/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0 + 0.13.0-SNAPSHOT com.ibm.wala.cast.python.jython diff --git a/com.ibm.wala.cast.python.jython3.test/pom.xml b/com.ibm.wala.cast.python.jython3.test/pom.xml index a7d757189..5b2f0bdaa 100644 --- a/com.ibm.wala.cast.python.jython3.test/pom.xml +++ b/com.ibm.wala.cast.python.jython3.test/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0 + 0.13.0-SNAPSHOT com.ibm.wala.cast.python.jython3.test diff --git a/com.ibm.wala.cast.python.jython3/pom.xml b/com.ibm.wala.cast.python.jython3/pom.xml index 4c0f2e2e5..2d8062b9c 100644 --- a/com.ibm.wala.cast.python.jython3/pom.xml +++ b/com.ibm.wala.cast.python.jython3/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0 + 0.13.0-SNAPSHOT com.ibm.wala.cast.python.jython3 diff --git a/com.ibm.wala.cast.python.ml.test/pom.xml b/com.ibm.wala.cast.python.ml.test/pom.xml index e7f35abe5..9413b8152 100644 --- a/com.ibm.wala.cast.python.ml.test/pom.xml +++ b/com.ibm.wala.cast.python.ml.test/pom.xml @@ -4,14 +4,14 @@ com.ibm.wala ml - 0.12.0 + 0.13.0-SNAPSHOT com.ibm.wala.cast.python.ml.test ${project.groupId} com.ibm.wala.cast.python.jython.test - 0.12.0 + 0.13.0-SNAPSHOT ${project.groupId} diff --git a/com.ibm.wala.cast.python.ml/pom.xml b/com.ibm.wala.cast.python.ml/pom.xml index d208c3879..ac876652d 100644 --- a/com.ibm.wala.cast.python.ml/pom.xml +++ b/com.ibm.wala.cast.python.ml/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0 + 0.13.0-SNAPSHOT com.ibm.wala.cast.python.ml diff --git a/com.ibm.wala.cast.python.test/pom.xml b/com.ibm.wala.cast.python.test/pom.xml index c70f0c3e9..ed1a8e05a 100644 --- a/com.ibm.wala.cast.python.test/pom.xml +++ b/com.ibm.wala.cast.python.test/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0 + 0.13.0-SNAPSHOT com.ibm.wala.cast.python.test diff --git a/com.ibm.wala.cast.python/pom.xml b/com.ibm.wala.cast.python/pom.xml index 5c1c5c99d..9ab0aea55 100644 --- a/com.ibm.wala.cast.python/pom.xml +++ b/com.ibm.wala.cast.python/pom.xml @@ -4,7 +4,7 @@ com.ibm.wala ml - 0.12.0 + 0.13.0-SNAPSHOT com.ibm.wala.cast.python diff --git a/pom.xml b/pom.xml index fa2b29389..3892bead5 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.ibm.wala ml - 0.12.0 + 0.13.0-SNAPSHOT pom com.ibm.wala.cast.python