fix error-message formatting

Closes PR 12565
This commit is contained in:
Matthew Flatt 2012-02-09 22:03:13 -07:00
parent 937cdf51d7
commit 6abb87069c
2 changed files with 9 additions and 2 deletions

View File

@ -632,6 +632,13 @@
(provide f)
(define (f) (s 1 2)))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check printing of an error message:
(err/rt-test (eval '(module bad-module racket/base
(require (for-meta -1 (only-in racket cons) (only-in r5rs cons)))))
(lambda (exn) (regexp-match? #rx"phase -1" (exn-message exn))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)

View File

@ -6083,7 +6083,7 @@ static void check_require_name(Scheme_Object *prnt_name, Scheme_Object *name,
phase_expl = " for syntax";
else {
char buf[32];
sprintf(buf, " for phase %" PRIxPTR, SCHEME_INT_VAL(phase));
sprintf(buf, " for phase %" PRIdPTR, SCHEME_INT_VAL(phase));
phase_expl = scheme_strdup(buf);
}
@ -8456,7 +8456,7 @@ void compute_provide_arrays(Scheme_Hash_Table *all_provided, Scheme_Hash_Table *
if (SCHEME_FALSEP(phase)) {
phase_expl = " for-label";
} else {
sprintf(buf, " for phase %" PRIxPTR, SCHEME_INT_VAL(phase));
sprintf(buf, " for phase %" PRIdPTR, SCHEME_INT_VAL(phase));
phase_expl = scheme_strdup(buf);
}
} else