Skip to content

Commit fa84f2d

Browse files
Minor changes
1 parent b70576a commit fa84f2d

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

lisa/lisa-analyses/src/main/java/it/unive/lisa/analysis/string/SubstringDomain.java

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,12 @@ public SubstringDomain assign(
147147
strType = expression.getStaticType();
148148

149149
Set<SymbolicExpression> expressions = extrPlus(expression, pp, oracle, strType);
150-
151150
SubstringDomain result = mk(lattice, mkNewFunction(function, false));
152151

153152
result = result.remove(expressions, id);
154-
155153
result = result.add(expressions, id);
156-
157154
result = result.interasg(id, expression);
158-
159155
result = result.closure(id);
160-
161156
return result.clear();
162157
}
163158

@@ -216,40 +211,26 @@ public SubstringDomain assume(
216211
throw new SemanticException("instanceof right");
217212

218213
Set<SymbolicExpression> extracted = extrPlus((ValueExpression) right, src, oracle, strType);
219-
220214
SubstringDomain result = mk(lattice, mkNewFunction(function, false));
221215

222216
result = result.add(extracted, (Identifier) left);
223-
224217
result = result.closure();
225-
226218
return result.clear();
227219

228220
} else if (binaryOperator instanceof StringEquals) {
229-
/*
230-
* Case both operands are identifiers
231-
*/
232-
if ((left instanceof Identifier) && (right instanceof Identifier)) {
233221

222+
// case both operands are identifiers
223+
if ((left instanceof Identifier) && (right instanceof Identifier)) {
234224
SubstringDomain result = mk(lattice, mkNewFunction(function, false));
235-
236225
result = result.add(left, (Identifier) right);
237226
result = result.add(right, (Identifier) left);
238-
239227
result = result.closure();
240-
241228
return result.clear();
242229
}
243-
244-
/*
245-
* Case where only one is an identifier
246-
*/
230+
// case where only one is an identifier
247231
else if ((left instanceof Identifier) || (right instanceof Identifier)) {
248-
249232
if (right instanceof Identifier) {
250-
/*
251-
* Make left the identifier
252-
*/
233+
// make left the identifier
253234
SymbolicExpression temp = left;
254235
left = right;
255236
right = temp;
@@ -263,9 +244,7 @@ else if ((left instanceof Identifier) || (right instanceof Identifier)) {
263244
SubstringDomain result = mk(lattice, mkNewFunction(function, false));
264245

265246
result = result.add(add, (Identifier) left);
266-
267247
result = result.closure();
268-
269248
return result.clear();
270249

271250
}
@@ -277,7 +256,6 @@ else if ((left instanceof Identifier) || (right instanceof Identifier)) {
277256

278257
ValueExpression rightValueExpression = (ValueExpression) right;
279258
ValueExpression leftValueExpression = (ValueExpression) left;
280-
281259
SubstringDomain leftDomain = assume(leftValueExpression, src, dest, oracle);
282260
SubstringDomain rightDomain = assume(rightValueExpression, src, dest, oracle);
283261

@@ -323,7 +301,6 @@ public SubstringDomain forgetIdentifier(
323301
// !=
324302
// null
325303
newFunction.remove(id);
326-
327304
newFunction.replaceAll((
328305
key,
329306
value) -> removeFromSet(value, id));

0 commit comments

Comments
 (0)