Skip to content

Commit 12210bc

Browse files
authored
Merge pull request #140 from secure-software-engineering/feature/opal
Implementation of Opal-Scope
2 parents c45a991 + b474082 commit 12210bc

File tree

680 files changed

+15228
-4894
lines changed

Some content is hidden

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

680 files changed

+15228
-4894
lines changed

.github/workflows/deploy.yml

+19
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,22 @@ jobs:
5959
gh pr create --draft -B develop -H ${{ env.BRANCH_NAME }} -t "Update to next SNAPSHOT version" -b "Update to next SNAPSHOT version"
6060
env:
6161
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
63+
release:
64+
runs-on: ubuntu-latest
65+
needs: deployment
66+
steps:
67+
- name: Checkout source code
68+
uses: actions/checkout@v4
69+
with:
70+
fetch-depth: 0
71+
72+
- name: Get latest tag
73+
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
74+
75+
- name: Create GitHub release
76+
run: |
77+
gh release create "$TAG"
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
TAG: ${{ steps.get_tag.outputs.tag }}

.github/workflows/maven.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111

1212
jobs:
1313
BuildAndTest:
14+
strategy:
15+
matrix:
16+
framework: [Soot, Opal] # TODO Add SootUp when available
1417
runs-on: ubuntu-latest
1518
steps:
1619
- name: Checkout source code
@@ -22,4 +25,4 @@ jobs:
2225
java-package: jdk
2326
java-version: 11
2427
- name: Build with Maven
25-
run: mvn -B clean verify
28+
run: mvn -B clean verify -DtestSetup=${{ matrix.framework }}

PDS/src/main/java/de/fraunhofer/iem/Empty.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package de.fraunhofer.iem;

PDS/src/main/java/de/fraunhofer/iem/Location.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package de.fraunhofer.iem;

PDS/src/main/java/de/fraunhofer/iem/wildcard/ExclusionWildcard.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package de.fraunhofer.iem.wildcard;

PDS/src/main/java/de/fraunhofer/iem/wildcard/Wildcard.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package de.fraunhofer.iem.wildcard;

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This repository contains:
99
- a Java implementation of [Synchronized Pushdown Systems](https://digital.ub.uni-paderborn.de/hs/content/titleinfo/3030984).
1010
- [Boomerang](boomerangPDS) to calculate on-demand points-to and dataflow information using a Synchronized Pushdown System.
1111
- [IDEal](idealPDS), an IDE solver based on a [Weighted Pushdown System](https://www.bodden.de/pubs/sab19context.pdf) that uses Boomerang to compute alias information only when required (i.e. on-demand).
12-
- Implementation of scopes that allows you to run Boomerang and IDEal with the static analysis frameworks Soot.
12+
- Implementation of scopes that allows you to run Boomerang and IDEal with the static analysis frameworks Soot and Opal.
1313

1414
## Examples
1515

@@ -38,6 +38,14 @@ The projects are released on [Maven Central](https://central.sonatype.com/artifa
3838
</dependency>
3939
```
4040

41+
## Build and Installation
42+
If you plan to install Boomerang and IDEal locally, you can use the following commands to build the project:
43+
44+
- `mvn clean install -DskipTests` Install the projects and skip all tests
45+
- `mvn clean install -DtestSetup=Soot` Install the projects and run the tests with Soot as the underlying framework
46+
- `mvn clean install -DtestSetup=SootUp` Install the projects and run the tests with SootUp as the underlying framework
47+
- `mvn clean install -DtestSetup=Opal` Install the projects and run the tests with Opal as the underlying framework
48+
4149
## Contributing
4250

4351
We hare happy for every contribution from the community! You can simply create a fork and open a pull request. Note that we use the Google style sheet to keep the code clean. To format the code, run the command

SparseBoomerangCorrectness/src/main/java/aliasing/SparseAliasManager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import boomerang.Boomerang;
55
import boomerang.DefaultBoomerangOptions;
66
import boomerang.results.BackwardBoomerangResults;
7-
import boomerang.scene.*;
8-
import boomerang.scene.jimple.*;
7+
import boomerang.scope.*;
8+
import boomerang.scope.jimple.*;
99
import boomerang.sparse.SparsificationStrategy;
1010
import boomerang.util.AccessPath;
1111
import com.google.common.base.Stopwatch;

SparseBoomerangCorrectness/src/test/java/test/aliasing/AliasingTestSetUp.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import static org.junit.Assert.assertTrue;
44

55
import aliasing.SparseAliasManager;
6-
import boomerang.scene.jimple.BoomerangPretransformer;
6+
import boomerang.scope.jimple.BoomerangPretransformer;
77
import boomerang.util.AccessPath;
88
import com.google.common.base.Predicate;
99
import java.io.File;

SynchronizedPDS/src/main/java/sync/pds/solver/CastNormalRule.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package sync.pds.solver;

SynchronizedPDS/src/main/java/sync/pds/solver/EmptyStackWitnessListener.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package sync.pds.solver;

SynchronizedPDS/src/main/java/sync/pds/solver/OneWeightFunctions.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package sync.pds.solver;

SynchronizedPDS/src/main/java/sync/pds/solver/SyncPDSSolver.java

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package sync.pds.solver;
@@ -16,11 +19,11 @@
1619
import com.google.common.collect.Lists;
1720
import com.google.common.collect.Maps;
1821
import com.google.common.collect.Multimap;
19-
import com.google.common.collect.Sets;
2022
import de.fraunhofer.iem.Location;
2123
import java.util.AbstractMap;
2224
import java.util.Collection;
2325
import java.util.HashSet;
26+
import java.util.LinkedHashSet;
2427
import java.util.Map;
2528
import java.util.Map.Entry;
2629
import java.util.Set;
@@ -70,10 +73,10 @@ public String toString() {
7073
return "Field " + SyncPDSSolver.this;
7174
}
7275
};
73-
private final Set<Node<Stmt, Fact>> reachedStates = Sets.newHashSet();
74-
private final Set<Node<Stmt, Fact>> callingContextReachable = Sets.newHashSet();
75-
private final Set<Node<Stmt, Fact>> fieldContextReachable = Sets.newHashSet();
76-
private final Set<SyncPDSUpdateListener<Stmt, Fact>> updateListeners = Sets.newHashSet();
76+
private final Set<Node<Stmt, Fact>> reachedStates = new LinkedHashSet<>();
77+
private final Set<Node<Stmt, Fact>> callingContextReachable = new LinkedHashSet<>();
78+
private final Set<Node<Stmt, Fact>> fieldContextReachable = new LinkedHashSet<>();
79+
private final Set<SyncPDSUpdateListener<Stmt, Fact>> updateListeners = new LinkedHashSet<>();
7780
private final Multimap<Node<Stmt, Fact>, SyncStatePDSUpdateListener<Stmt, Fact>>
7881
reachedStateUpdateListeners = HashMultimap.create();
7982
protected final WeightedPAutomaton<Field, INode<Node<Stmt, Fact>>, W> fieldAutomaton;
@@ -594,8 +597,8 @@ private void applyCallSummary(Stmt callSite, Fact factInCallee, Stmt spInCallee)
594597
});
595598
}
596599

597-
Set<Summary> summaries = Sets.newHashSet();
598-
Set<OnAddedSummaryListener> summaryListeners = Sets.newHashSet();
600+
Set<Summary> summaries = new LinkedHashSet<>();
601+
Set<OnAddedSummaryListener> summaryListeners = new LinkedHashSet<>();
599602

600603
public void addApplySummaryListener(OnAddedSummaryListener l) {
601604
if (summaryListeners.add(l)) {
@@ -794,17 +797,17 @@ public void addGeneratedFieldState(GeneratedState<Node<Stmt, Fact>, Field> state
794797
public abstract Field fieldWildCard();
795798

796799
public Set<Node<Stmt, Fact>> getReachedStates() {
797-
return Sets.newHashSet(reachedStates);
800+
return new LinkedHashSet(reachedStates);
798801
}
799802

800803
public void debugOutput() {
801804
logger.debug(this.getClass().toString());
802805
logger.debug("All reachable states");
803806
prettyPrintSet(getReachedStates());
804807

805-
HashSet<Node<Stmt, Fact>> notFieldReachable = Sets.newHashSet(callingContextReachable);
808+
HashSet<Node<Stmt, Fact>> notFieldReachable = new LinkedHashSet(callingContextReachable);
806809
notFieldReachable.removeAll(getReachedStates());
807-
HashSet<Node<Stmt, Fact>> notCallingContextReachable = Sets.newHashSet(fieldContextReachable);
810+
HashSet<Node<Stmt, Fact>> notCallingContextReachable = new LinkedHashSet(fieldContextReachable);
808811
notCallingContextReachable.removeAll(getReachedStates());
809812
if (!notFieldReachable.isEmpty()) {
810813
logger.debug("Calling context reachable");

SynchronizedPDS/src/main/java/sync/pds/solver/SyncPDSUpdateListener.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package sync.pds.solver;

SynchronizedPDS/src/main/java/sync/pds/solver/SyncStatePDSUpdateListener.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package sync.pds.solver;

SynchronizedPDS/src/main/java/sync/pds/solver/WeightFunctions.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/**
22
* *****************************************************************************
3-
* Copyright (c) 2025 Fraunhofer IEM, Paderborn, Germany. This program and the
4-
* accompanying materials are made available under the terms of the Eclipse
5-
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
6-
*
7-
* <p>SPDX-License-Identifier: EPL-2.0
8-
*
9-
* <p>Contributors: Johannes Spaeth - initial API and implementation
3+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany
4+
* <p>
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0.
8+
* <p>
9+
* SPDX-License-Identifier: EPL-2.0
10+
* <p>
11+
* Contributors:
12+
* Johannes Spaeth - initial API and implementation
1013
* *****************************************************************************
1114
*/
1215
package sync.pds.solver;

0 commit comments

Comments
 (0)