diff --git a/src/hilight.c b/src/hilight.c index 498cc584..779c9022 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -194,13 +194,15 @@ Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int wha return ptr2; } -Hilight_hashentry *hier_hilight_hash_lookup(const char *token, int value, char *path, int what) +Hilight_hashentry *hier_hilight_hash_lookup(const char *token, int value, const char *path, int what) { Hilight_hashentry *entry; char *oldpath = xctx->sch_path[xctx->currsch]; xctx->sch_path_hash[xctx->currsch] = 0; - xctx->sch_path[xctx->currsch] = path; + xctx->sch_path[xctx->currsch] = NULL; + my_strdup2(_ALLOC_ID_, &xctx->sch_path[xctx->currsch], path); entry = bus_hilight_hash_lookup(token, value, what); + my_free(_ALLOC_ID_, &xctx->sch_path[xctx->currsch]); xctx->sch_path[xctx->currsch] = oldpath; xctx->sch_path_hash[xctx->currsch] = 0; return entry; diff --git a/src/scheduler.c b/src/scheduler.c index c248f116..c3b6729f 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -5414,10 +5414,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg del_object_table(); Tcl_ResetResult(interp); } - else if(argc > 2 && atoi(argv[2]) == 2) { + else if(argc > 4 && atoi(argv[2]) == 2) { prepare_netlist_structs(0); - hier_hilight_hash_lookup("LDCP_REF", 0, ".x17.xctrl.", XINSERT); - hier_hilight_hash_lookup(" x4", 1, ".x17.xctrl.", XINSERT); + hier_hilight_hash_lookup(argv[4], 0, argv[3], XINSERT); propagate_hilights(1, 0, XINSERT_NOREPLACE); Tcl_ResetResult(interp); } diff --git a/src/xschem.h b/src/xschem.h index 42d52dd8..9f1f6173 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -1304,7 +1304,7 @@ extern Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, /* wrapper function to hash highlighted instances, avoid clash with net names */ extern Hilight_hashentry *inst_hilight_hash_lookup(int i, int value, int what); /* wrapper to bus_hilight_hash_lookup that provides a signal path instead of using xctx->sch_path */ -extern Hilight_hashentry *hier_hilight_hash_lookup(const char *token, int value, char *path, int what); +extern Hilight_hashentry *hier_hilight_hash_lookup(const char *token, int value, const char *path, int what); extern Hilight_hashentry *hilight_lookup(const char *token, int value, int what); extern int search(const char *tok, const char *val, int sub, int sel, int match_case); extern int process_options(int argc, char **argv);