Fix cycle detection for SGs.

bug 7318821

Change-Id: I695d7230551d8512c6c3f0c31c57f12498da7036
1 file changed