From: yu.dongliang <18588496441@163.com> Date: Fri, 10 Nov 2023 08:44:55 +0000 (+0800) Subject: __dfs_path() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=741ca6cb63ca9391ae1e4b8119ced86ccc47b346;p=ses.git __dfs_path() --- diff --git a/ses_step_topo.c b/ses_step_topo.c index 5a7799f..e533a43 100644 --- a/ses_step_topo.c +++ b/ses_step_topo.c @@ -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; }