expander: fix module cache when current-load-relative-directory is #f

Corrects a problem with 4525c231a7.
This commit is contained in:
Matthew Flatt 2020-10-05 14:03:15 -06:00
parent e4a7ca7774
commit da6fd94fe1
3 changed files with 13 additions and 3 deletions

View File

@ -38630,7 +38630,14 @@ static const char *startup_source =
"(lambda(hash-code_0)"
"(begin"
"(if hash-code_0"
" (string->symbol (format \"~s\" (list hash-code_0 (path->directory-path (current-load-relative-directory)))))"
"(string->symbol"
"(format"
" \"~s\""
"(list"
" hash-code_0"
"(path->directory-path"
"(let-values(((or-part_0)(current-load-relative-directory)))"
"(if or-part_0 or-part_0(current-directory)))))))"
" #f))))"
"(define-values"
"(module-cache-set!)"

View File

@ -46072,7 +46072,9 @@
"~s"
(list
hash-code_0
(path->directory-path (current-load-relative-directory)))))
(path->directory-path
(let ((or-part_0 (current-load-relative-directory)))
(if or-part_0 or-part_0 (current-directory)))))))
#f)))
(define module-cache-set!
(lambda (key_0 proc_0)

View File

@ -29,7 +29,8 @@
;; Encode as a symbol so we can use an eq?-based hash table
;; (i.e., explot the low-level lock on the symbol table)
(string->symbol (format "~s" (list hash-code (path->directory-path
(current-load-relative-directory)))))))
(or (current-load-relative-directory)
(current-directory))))))))
(define (module-cache-set! key proc)
(hash-set! module-cache key (make-ephemeron key proc)))