Skip to content

Commit 9e97b89

Browse files
authored
Merge pull request #847 from MarcMil/extensible
Fix non-exclusive summaries
2 parents d70aaf7 + 0b30a52 commit 9e97b89

File tree

124 files changed

+203
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+203
-158
lines changed

soot-infoflow-summaries/src/soot/jimple/infoflow/methodSummary/data/provider/MergingSummaryProvider.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ public ClassMethodSummaries getMethodFlows(String className, String methodSignat
5252
for (IMethodSummaryProvider provider : innerProviders) {
5353
ClassMethodSummaries providerSummaries = provider.getMethodFlows(className, methodSignature);
5454
if (providerSummaries != null) {
55-
if (summaries == null)
56-
summaries = new ClassMethodSummaries(className);
55+
if (summaries == null) {
56+
summaries = new ClassMethodSummaries(providerSummaries);
57+
}
5758
summaries.merge(providerSummaries);
5859
}
5960
}
@@ -80,8 +81,9 @@ public ClassMethodSummaries getClassFlows(String clazz) {
8081
for (IMethodSummaryProvider provider : innerProviders) {
8182
ClassMethodSummaries providerSummaries = provider.getClassFlows(clazz);
8283
if (providerSummaries != null) {
83-
if (summaries == null)
84-
summaries = new ClassMethodSummaries(clazz);
84+
if (summaries == null) {
85+
summaries = new ClassMethodSummaries(providerSummaries);
86+
}
8587
summaries.merge(providerSummaries);
8688
}
8789
}

soot-infoflow-summaries/src/soot/jimple/infoflow/methodSummary/data/summary/ClassMethodSummaries.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ public class ClassMethodSummaries {
1919

2020
private boolean isExclusiveForClass = true;
2121

22+
/**
23+
* Creates a shallow copy from an existing class method summary instance.
24+
* @param from the source from which to copy
25+
*/
26+
public ClassMethodSummaries(ClassMethodSummaries from) {
27+
this.className = from.className;
28+
//shallow copy
29+
this.methodSummaries = from.methodSummaries;
30+
this.isInterface = from.isInterface;
31+
this.interfaces.addAll(from.interfaces);
32+
this.superClass = from.superClass;
33+
}
34+
2235
public ClassMethodSummaries(String className) {
2336
this.className = className;
2437
this.methodSummaries = new MethodSummaries();
@@ -126,6 +139,9 @@ public boolean merge(ClassMethodSummaries methodFlows) {
126139
if (isInterface == null && methodFlows.isInterface != null)
127140
this.isInterface = methodFlows.isInterface;
128141

142+
if (methodFlows.isExclusiveForClass())
143+
setExclusiveForClass(true);
144+
129145
return hasNewData;
130146
}
131147

soot-infoflow-summaries/summariesManual/System.String.xml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,35 @@
4343
</method>
4444
<method id="System.String Concat(System.Object)">
4545
<flows>
46-
<flow isAlias="false" typeChecking="false">
46+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
4747
<from sourceSinkType="Parameter" ParameterIndex="0"/>
4848
<to sourceSinkType="Return" />
4949
</flow>
5050
</flows>
5151
</method>
5252
<method id="System.String Concat(System.Object,System.Object)">
5353
<flows>
54-
<flow isAlias="false" typeChecking="false">
54+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
5555
<from sourceSinkType="Parameter" ParameterIndex="0"/>
5656
<to sourceSinkType="Return" />
5757
</flow>
58-
<flow isAlias="false" typeChecking="false">
58+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
5959
<from sourceSinkType="Parameter" ParameterIndex="1"/>
6060
<to sourceSinkType="Return" />
6161
</flow>
6262
</flows>
6363
</method>
6464
<method id="System.String Concat(System.Object,System.Object,System.Object)">
6565
<flows>
66-
<flow isAlias="false" typeChecking="false">
66+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
6767
<from sourceSinkType="Parameter" ParameterIndex="0"/>
6868
<to sourceSinkType="Return" />
6969
</flow>
70-
<flow isAlias="false" typeChecking="false">
70+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
7171
<from sourceSinkType="Parameter" ParameterIndex="1"/>
7272
<to sourceSinkType="Return" />
7373
</flow>
74-
<flow isAlias="false" typeChecking="false">
74+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
7575
<from sourceSinkType="Parameter" ParameterIndex="2"/>
7676
<to sourceSinkType="Return" />
7777
</flow>
@@ -136,7 +136,7 @@
136136
</method>
137137
<method id="System.String Concat(System.Object[])">
138138
<flows>
139-
<flow isAlias="false" typeChecking="false">
139+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
140140
<from sourceSinkType="Parameter" ParameterIndex="0"/>
141141
<to sourceSinkType="Return" />
142142
</flow>
@@ -164,7 +164,7 @@
164164
<from sourceSinkType="Parameter" ParameterIndex="0"/>
165165
<to sourceSinkType="Return" />
166166
</flow>
167-
<flow isAlias="false" typeChecking="false">
167+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
168168
<from sourceSinkType="Parameter" ParameterIndex="1"/>
169169
<to sourceSinkType="Return" />
170170
</flow>
@@ -200,6 +200,10 @@
200200
<from sourceSinkType="Parameter" ParameterIndex="0"/>
201201
<to sourceSinkType="Return" />
202202
</flow>
203+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
204+
<from sourceSinkType="Parameter" ParameterIndex="1"/>
205+
<to sourceSinkType="Return" />
206+
</flow>
203207
</flows>
204208
</method>
205209
<method id="System.String Trim(char[])">
@@ -232,7 +236,7 @@
232236
<from sourceSinkType="Parameter" ParameterIndex="0" />
233237
<to sourceSinkType="Return" />
234238
</flow>
235-
<flow isAlias="false" typeChecking="false">
239+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
236240
<from sourceSinkType="Parameter" ParameterIndex="1" />
237241
<to sourceSinkType="Return" />
238242
</flow>
@@ -244,11 +248,11 @@
244248
<from sourceSinkType="Parameter" ParameterIndex="0" />
245249
<to sourceSinkType="Return" />
246250
</flow>
247-
<flow isAlias="false" typeChecking="false">
251+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
248252
<from sourceSinkType="Parameter" ParameterIndex="1" />
249253
<to sourceSinkType="Return" />
250254
</flow>
251-
<flow isAlias="false" typeChecking="false">
255+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
252256
<from sourceSinkType="Parameter" ParameterIndex="2" />
253257
<to sourceSinkType="Return" />
254258
</flow>
@@ -260,7 +264,7 @@
260264
<from sourceSinkType="Parameter" ParameterIndex="0" />
261265
<to sourceSinkType="Return" />
262266
</flow>
263-
<flow isAlias="false" typeChecking="false">
267+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
264268
<from sourceSinkType="Parameter" ParameterIndex="1" />
265269
<to sourceSinkType="Return" />
266270
</flow>
@@ -280,7 +284,7 @@
280284
<from sourceSinkType="Parameter" ParameterIndex="0" />
281285
<to sourceSinkType="Return" />
282286
</flow>
283-
<flow isAlias="false" typeChecking="false">
287+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
284288
<from sourceSinkType="Parameter" ParameterIndex="1" />
285289
<to sourceSinkType="Return" />
286290
</flow>

soot-infoflow-summaries/summariesManual/System.Text.StringBuilder.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
</method>
196196
<method id="System.Text.StringBuilder Append(System.Object)">
197197
<flows>
198-
<flow isAlias="false" typeChecking="false">
198+
<flow isAlias="false" typeChecking="false" cutSubfields="true">
199199
<from sourceSinkType="Parameter" ParameterIndex="0" />
200200
<to sourceSinkType="Field" />
201201
</flow>

soot-infoflow-summaries/summariesManual/android.content.Intent.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,7 @@
13411341
</flow>
13421342
</flows>
13431343
</method>
1344+
13441345
<method id="android.content.Intent setAction(java.lang.String)">
13451346
<flows>
13461347
<flow isAlias="false" typeChecking="false">

soot-infoflow-summaries/summariesManual/androidx.collection.SimpleArrayMap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" ?>
2-
<summary fileFormatVersion="101">
2+
<summary fileFormatVersion="101" isExclusive="true">
33
<methods>
44
<method id="java.lang.Object put(java.lang.Object,java.lang.Object)">
55
<constraints>

soot-infoflow-summaries/summariesManual/com.esotericsoftware.kryo.io.ByteBufferOutput.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" ?>
2-
<summary fileFormatVersion="101">
2+
<summary fileFormatVersion="101" isExclusive="true">
33
<hierarchy superClass="com.esotericsoftware.kryo.io.Output" />
44

55
<methods>

soot-infoflow-summaries/summariesManual/com.esotericsoftware.kryo.io.Output.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" ?>
2-
<summary fileFormatVersion="101">
2+
<summary fileFormatVersion="101" isExclusive="true">
33
<hierarchy superClass="java.io.OutputStream">
44
<interface name="com.esotericsoftware.kryo.util.Pool$Poolable" />
55
</hierarchy>

soot-infoflow-summaries/summariesManual/com.google.api.client.http.HttpResponse.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" ?>
2-
<summary fileFormatVersion="101">
2+
<summary fileFormatVersion="101" isExclusive="true">
33
<methods>
44
<method id="void &lt;init&gt;(com.google.api.client.http.HttpRequest,com.google.api.client.http.LowLevelHttpResponse)">
55
<flows>

soot-infoflow-summaries/summariesManual/com.google.common.collect.HashBasedTable.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" ?>
2-
<summary fileFormatVersion="101">
2+
<summary fileFormatVersion="101" isExclusive="true">
33
<hierarchy superClass="java.lang.Object">
44
<interface name="com.google.common.collect.Table" />
55
</hierarchy>

0 commit comments

Comments
 (0)