Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-10-27 13:29:46 +0300
committerJacques Lucke <jacques@blender.org>2021-10-27 13:29:59 +0300
commitc06a86f99f5bd59e2f1c37b18f5e668da245a206 (patch)
tree1fda9694ccd190389fb29063cd04c4017a36e528 /source/blender/nodes/NOD_node_tree_ref.hh
parentd161b5d204a585b910a47ca432544570ea10911e (diff)
Fix T92328: crash during field inferencing when there is a link cycle
The toposort did not handle link cycles which it should.
Diffstat (limited to 'source/blender/nodes/NOD_node_tree_ref.hh')
-rw-r--r--source/blender/nodes/NOD_node_tree_ref.hh12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/nodes/NOD_node_tree_ref.hh b/source/blender/nodes/NOD_node_tree_ref.hh
index 9f9dcc69376..e04dd7f41bd 100644
--- a/source/blender/nodes/NOD_node_tree_ref.hh
+++ b/source/blender/nodes/NOD_node_tree_ref.hh
@@ -287,7 +287,17 @@ class NodeTreeRef : NonCopyable, NonMovable {
RightToLeft,
};
- Vector<const NodeRef *> toposort(ToposortDirection direction) const;
+ struct ToposortResult {
+ Vector<const NodeRef *> sorted_nodes;
+ /**
+ * There can't be a correct topologycal sort of the nodes when there is a cycle. The nodes will
+ * still be sorted to some degree. The caller has to decide whether it can handle non-perfect
+ * sorts or not.
+ */
+ bool has_cycle = false;
+ };
+
+ ToposortResult toposort(ToposortDirection direction) const;
bNodeTree *btree() const;
StringRefNull name() const;