__dfs_path()
authoryu.dongliang <18588496441@163.com>
Fri, 10 Nov 2023 08:44:55 +0000 (16:44 +0800)
committeryu.dongliang <18588496441@163.com>
Fri, 10 Nov 2023 08:44:55 +0000 (16:44 +0800)
ses_step_topo.c

index 5a7799ffbaf6735afdfa92dcf65cf7bc1cf25dfe..e533a43fe8ffb3b9078dc2556650b54e75d192db 100644 (file)
@@ -91,22 +91,25 @@ int __dfs_path(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* rp, scf_vector_t* __
                        c  = f->components[el->pins[j]];
                        p  = c->pins      [el->pins[j + 1]];
 
-                       if (p->pflag && p != np && *ppath) {
-                               scf_logd("branch: c%ld_p%ld, l%ld\n", c->id, p->id, el->id);
+                       if (p->pflag) {
 
-                               if ((*ppath)->pins->size > 0) {
-                                       if (scf_vector_add(__paths, *ppath) < 0)
-                                               return -ENOMEM;
+                               if (p != np && *ppath) {
+                                       scf_logd("branch: c%ld_p%ld, l%ld\n", c->id, p->id, el->id);
+
+                                       if ((*ppath)->pins->size > 0) {
+                                               if (scf_vector_add(__paths, *ppath) < 0)
+                                                       return -ENOMEM;
 
-                                       for (k = 0; k < (*ppath)->pins->size; k++) {
-                                               p         = (*ppath)->pins->data[k];
-                                               p->pflag  = 1;
-                                               p->path   = (uintptr_t)*ppath;
-                                       }
-                               } else
-                                       ses_path_free(*ppath);
+                                               for (k = 0; k < (*ppath)->pins->size; k++) {
+                                                       p         = (*ppath)->pins->data[k];
+                                                       p->pflag  = 1;
+                                                       p->path   = (uintptr_t)*ppath;
+                                               }
+                                       } else
+                                               ses_path_free(*ppath);
 
-                               *ppath = NULL;
+                                       *ppath = NULL;
+                               }
                                continue;
                        }