From 37bae6ffc31c25fcf23ed4b9fef5ce6e67a18955 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Fri, 27 Apr 2018 21:11:21 +0200 Subject: [PATCH] Fix import-library-hook in eval-modules so it won't call #f When used in a statically compiled program, the '##sys#import property will be missing from the module if it isn't linked into the program. We were calling the procedure value on the '##sys#import property, instead of checking whether it is set. Found during investigation of #1437 --- eval-modules.scm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eval-modules.scm b/eval-modules.scm index e05e2bd3..5724c294 100644 --- a/eval-modules.scm +++ b/eval-modules.scm @@ -98,6 +98,5 @@ (set! ##sys#import-library-hook (let ((hook ##sys#import-library-hook)) (lambda (mname) - (let ((il (get mname '##sys#import))) - (or (il) - (hook mname)))))) + (cond ((get mname '##sys#import) => (lambda (il) (il))) + (else (hook mname)) ) ) ) ) -- 2.11.0