From 02f0a416cc3df5cb348303f86549a8461e718cac Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Wed, 23 Dec 2020 15:57:28 +0100 Subject: [PATCH] -a -m check for unbound instances (Joanne fix) --- scconfig/src/default/find_cc.c | 3 +++ scconfig/src/default/find_libs.c | 3 +++ src/hilight.c | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/scconfig/src/default/find_cc.c b/scconfig/src/default/find_cc.c index f2b9d700..83adf40d 100644 --- a/scconfig/src/default/find_cc.c +++ b/scconfig/src/default/find_cc.c @@ -747,6 +747,9 @@ static const char *test_host = NL "#include " NL "#include " NL "#include %s" + NL "#ifndef RTLD_NOW" + NL "#define RTLD_NOW RTLD_LAZY" /* on old BSD and probably on SunOS */ + NL "#endif" NL "int main() {" NL " void *handle = NULL;" NL " void (*func)() = NULL;" diff --git a/scconfig/src/default/find_libs.c b/scconfig/src/default/find_libs.c index 6f7d32c7..929690a4 100644 --- a/scconfig/src/default/find_libs.c +++ b/scconfig/src/default/find_libs.c @@ -59,6 +59,9 @@ int find_lib_ldl(const char *name, int logdepth, int fatal) char *test_c = NL "#include " NL "#include " + NL "#ifndef RTLD_NOW" + NL "#define RTLD_NOW RTLD_LAZY" /* on old BSD and probably on SunOS */ + NL "#endif" NL "int main() {" NL " void *handle;" NL " handle = dlopen(\"/this file does not exist.\", RTLD_NOW);" diff --git a/src/hilight.c b/src/hilight.c index af8080be..3a84a42a 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -799,6 +799,10 @@ void propagate_hilights(int set) char *type; for(i = 0; i < xctx->instances; i++) { + if(xctx->inst[i].ptr < 0 ) { + dbg(0, "propagate_hilights(): .ptr < 0, unbound symbol: instance %d, name=%s\n", i, xctx->inst[i].instname); + continue; + } if(xctx->inst[i].color) hilights = 1; /* some hilight instances -> don't clear xctx->hilight_nets */ type = (xctx->inst[i].ptr+ xctx->sym)->type; hilight_connected_inst = (xctx->inst[i].flags & 4) || ((xctx->inst[i].ptr+ xctx->sym)->flags & 4);