mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-07-08 11:30:42 +00:00
Prevent stack overflow in deps calc
This commit is contained in:
@@ -451,7 +451,7 @@ public abstract class DataStorage {
|
||||
entry.finalizeEntry();
|
||||
}
|
||||
|
||||
public Collection<DataStoreEntryRef<?>> getDependencies(DataStoreEntry entry) {
|
||||
public Set<DataStoreEntryRef<?>> getDependencies(DataStoreEntry entry) {
|
||||
var l = new HashSet<DataStoreEntryRef<?>>();
|
||||
|
||||
var store = entry.getStore();
|
||||
@@ -462,7 +462,9 @@ public abstract class DataStorage {
|
||||
var deps = store.getDependencies();
|
||||
l.addAll(deps);
|
||||
for (DataStoreEntryRef<?> dep : deps) {
|
||||
l.addAll(getDependencies(dep.get()));
|
||||
if (!l.contains(dep)) {
|
||||
l.addAll(getDependencies(dep.get()));
|
||||
}
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
@@ -686,8 +686,8 @@ public class DataStoreEntry extends StorageElement {
|
||||
}
|
||||
|
||||
try {
|
||||
store.checkComplete();
|
||||
incrementBusyCounter();
|
||||
store.checkComplete();
|
||||
if ((store instanceof ValidatableStore l)) {
|
||||
l.validate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user