fix sorting bug in bytecode submodule table
This commit is contained in:
parent
f099eec2af
commit
393e8b90b2
|
@ -523,6 +523,31 @@
|
|||
(dynamic-require p #f)
|
||||
(test 'for-submod dynamic-require `(submod ,p main) 'has-submod))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Try various submodule combinations to test sorting:
|
||||
|
||||
(let ()
|
||||
(define (try-submods l)
|
||||
(define e `(module e racket/base
|
||||
,@(for/list ([n l])
|
||||
`(module+ ,n
|
||||
(define name ',n)
|
||||
(provide name)))))
|
||||
(define fn (build-path (find-system-path 'temp-dir)
|
||||
"has-submod.rkt"))
|
||||
(define dir (build-path (find-system-path 'temp-dir)
|
||||
"compiled"))
|
||||
(define fn-zo (build-path dir "has-submod_rkt.zo"))
|
||||
(unless (directory-exists? dir) (make-directory dir))
|
||||
(with-output-to-file fn-zo
|
||||
#:exists 'truncate
|
||||
(lambda () (write (compile e))))
|
||||
(for ([n l])
|
||||
(test n dynamic-require `(submod ,fn ,n) 'name)))
|
||||
(try-submods '(a b))
|
||||
(try-submods '(xa xb))
|
||||
(try-submods '(test main)))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -1836,7 +1836,7 @@ static int compare_modules(const void *_am, const void *_bm)
|
|||
bs = SCHEME_BYTE_STR_VAL(b);
|
||||
|
||||
for (i = 0; (i < alen) && (i < blen); i++) {
|
||||
if (as[i] != bs[1])
|
||||
if (as[i] != bs[i])
|
||||
return as[i] - bs[i];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user