fix: topo handler __dfs_path()
authoryu.dongliang <18588496441@163.com>
Tue, 17 Oct 2023 14:59:05 +0000 (22:59 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 17 Oct 2023 14:59:05 +0000 (22:59 +0800)
ses_step_topo.c

index 64aa14a8054d6c854eb0e5b516b92da08efaf8d7..98a3b86e49936a9e377c9a00fa35addad0657183 100644 (file)
@@ -49,8 +49,7 @@ int __dfs_path(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* rp, scf_vector_t* __
                if (SCF_EDA_PIN_POS & el->flags) {
                        scf_loge("pos l%ld\n\n", el->id);
 
-                       ret       = SCF_EDA_Path_OFF;
-                       np->vflag = 1;
+                       ret = SCF_EDA_Path_OFF;
                        continue;
                }
 
@@ -91,13 +90,16 @@ int __dfs_path(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* rp, scf_vector_t* __
                        if (p->pflag && p != np && *ppath) {
                                scf_loge("branch: c%ld_p%ld, l%ld\n", c->id, p->id, el->id);
 
-                               if (scf_vector_add(__paths, *ppath) < 0)
-                                       return -ENOMEM;
+                               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;
-                               }
+                                       for (k = 0; k < (*ppath)->pins->size; k++) {
+                                               p         = (*ppath)->pins->data[k];
+                                               p->pflag  = 1;
+                                       }
+                               } else
+                                       ses_path_free(*ppath);
 
                                *ppath = NULL;
                                continue;
@@ -298,7 +300,6 @@ static int _topo_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t*
                }
        }
 
-       scf_loge("ctx->paths: %p, ctx->paths->size: %d\n", ctx->paths, ctx->paths->size);
        scf_vector_clear(ctx->paths, ( void (*)(void*) )ses_path_free);
 
        B    = f->components[0];