Followup to bug 559898: fix cycle checker to allow self-loop special case.
authorChris Jones <jones.chris.g@gmail.com>
Tue, 27 Apr 2010 02:12:39 -0500
changeset 46833 5f2417a777fefeedb0cd2881aac307a77c5cedef
parent 46832 952abd68aeabf9ac5f0ffbe37e3909f790ef9565
child 46834 88a23b9dd4c982abedfe4df003922f4dac477824
push id14210
push userdougt@mozilla.com
push dateThu, 01 Jul 2010 06:28:42 +0000
treeherdermozilla-central@3aff97777291 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs559898
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Followup to bug 559898: fix cycle checker to allow self-loop special case.
ipc/ipdl/ipdl/type.py
--- a/ipc/ipdl/ipdl/type.py
+++ b/ipc/ipdl/ipdl/type.py
@@ -953,16 +953,20 @@ class GatherDecls(TcheckVisitor):
 
 def checkcycles(p, stack=None):
     cycles = []
 
     if stack is None:
         stack = []
 
     for cp in p.manages:
+        # special case for self-managed protocols
+        if cp is p:
+            continue
+        
         if cp in stack:
             return [stack + [p, cp]]
         cycles += checkcycles(cp, stack + [p])
 
     return cycles
 
 def formatcycles(cycles):
     r = []