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 41432 59779c0f35944f25e821e221eae01a28a34731d3
parent 41431 f8e5a7f4450a49a245d2b644f7b3475646d65efe
child 41433 ac54f9c611f12e09e53990abc26916f3cb8bc7c1
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [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 = []