diff options
author | Jacques Lucke <jacques@blender.org> | 2021-10-27 13:29:46 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-10-27 13:29:59 +0300 |
commit | c06a86f99f5bd59e2f1c37b18f5e668da245a206 (patch) | |
tree | 1fda9694ccd190389fb29063cd04c4017a36e528 /source/blender/nodes/NOD_node_tree_ref.hh | |
parent | d161b5d204a585b910a47ca432544570ea10911e (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.hh | 12 |
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; |