diff options
-rw-r--r-- | libguile/dynl.c | 5 | ||||
-rw-r--r-- | test-suite/tests/foreign.test | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/libguile/dynl.c b/libguile/dynl.c index 2484ddaa0..a2ae6e267 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -115,9 +115,8 @@ sysdep_dynl_value (const char *symb, void *handle, const char *subr) fptr = lt_dlsym ((lt_dlhandle) handle, symb); if (!fptr) - { - scm_misc_error (subr, (char *) lt_dlerror (), SCM_EOL); - } + scm_misc_error (subr, "Symbol not found: ~a", + scm_list_1 (scm_from_locale_string (symb))); return fptr; } diff --git a/test-suite/tests/foreign.test b/test-suite/tests/foreign.test index 93e5fe1ca..1353e7dbb 100644 --- a/test-suite/tests/foreign.test +++ b/test-suite/tests/foreign.test @@ -28,6 +28,14 @@ #:use-module (test-suite lib)) +(with-test-prefix "dynamic-pointer" + + (pass-if-exception + "error message" + '(misc-error . "^Symbol not found") + (dynamic-func "does_not_exist___" (dynamic-link)))) + + (with-test-prefix "null pointer" (pass-if "pointer?" |