dynamic-place: fix use of expanders module-predefined?

Closes #2278
This commit is contained in:
Matthew Flatt 2018-09-22 18:26:04 -06:00
parent d06f6e7c4e
commit 45af149fc0
5 changed files with 24 additions and 9 deletions

View File

@ -0,0 +1,6 @@
#lang racket
(provide print)
(define (print ch)
(printf "This is 34 in a second place.\n"))

View File

@ -0,0 +1,14 @@
#lang racket/base
(require racket/place
racket/runtime-path)
(define-runtime-module-path-index mod-for-place "embed-me34-print.rkt")
(void
(place-wait
(dynamic-place
(let ([n (resolved-module-path-name (module-path-index-resolve mod-for-place))])
(if (symbol? n)
`(quote ,n)
n))
'print)))

View File

@ -266,7 +266,8 @@
(one-mz-test "embed-me18.rkt" "This is 18.\n" #f)
(one-mz-test "embed-me19.rkt" "This is 19.\n" #f)
(one-mz-test "embed-me21.rkt" "This is 21.\n" #f)
(one-mz-test "embed-me31.rkt" "This is 31.\n" #f))
(one-mz-test "embed-me31.rkt" "This is 31.\n" #f)
(one-mz-test "embed-me34.rkt" "This is 34 in a second place.\n" #f))
;; Try unicode expr and cmdline:
(prepare dest "unicode")

View File

@ -3795,7 +3795,7 @@ void scheme_embedded_load(intptr_t len, const char *desc, int predefined)
int scheme_is_predefined_module_path(Scheme_Object *m)
{
Scheme_Object *is_predef, *a[1], *r;
is_predef = scheme_get_startup_export("embedded-load");
is_predef = scheme_get_startup_export("module-predefined?");
a[0] = m;
r = scheme_apply(is_predef, 1, a);
return SCHEME_TRUEP(r);

View File

@ -255,12 +255,6 @@ static void close_six_fds(rktio_fd_t **rw) {
}
}
static int is_predefined_module_path(Scheme_Object *v)
{
/* Every table of primitives should have a corresponding predefined module */
return !!scheme_hash_get(scheme_startup_env->primitive_tables, v);
}
Scheme_Object *place_pumper_threads(int argc, Scheme_Object *args[]) {
Scheme_Place *place;
Scheme_Object *tmp;
@ -358,7 +352,7 @@ Scheme_Object *scheme_place(int argc, Scheme_Object *args[]) {
if (SCHEME_PAIRP(args[0])
&& SAME_OBJ(SCHEME_CAR(args[0]), quote_symbol)
&& !is_predefined_module_path(args[0])) {
&& !scheme_is_predefined_module_path(args[0])) {
scheme_contract_error("dynamic-place", "not a filesystem or predefined module-path",
"module path", 1, args[0],
NULL);