From ac6210c42e52e307ba8216bee1235d1ae1763869 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 26 Apr 2012 21:10:19 -0600 Subject: [PATCH] save modidx submodule path in bytecode form This change should have been part of 9ba663aa77a. original commit: f099eec2af7c48321b9e59c68f1083372e0e4e6c --- collects/compiler/decompile.rkt | 3 ++- collects/compiler/zo-marshal.rkt | 4 +++- collects/compiler/zo-parse.rkt | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/collects/compiler/decompile.rkt b/collects/compiler/decompile.rkt index fdf1904256..ac8808a940 100644 --- a/collects/compiler/decompile.rkt +++ b/collects/compiler/decompile.rkt @@ -161,7 +161,8 @@ (define (mpi->string modidx) (cond [(symbol? modidx) modidx] - [else (collapse-module-path-index modidx (current-directory))])) + [else + (collapse-module-path-index modidx (current-directory))])) (define (decompile-module mod-form orig-stack stx-ht mod-name) (match mod-form diff --git a/collects/compiler/zo-marshal.rkt b/collects/compiler/zo-marshal.rkt index c2c6754cd4..a05194725d 100644 --- a/collects/compiler/zo-marshal.rkt +++ b/collects/compiler/zo-marshal.rkt @@ -895,7 +895,9 @@ (out-byte CPT_MODULE_INDEX out) (let-values ([(name base) (module-path-index-split v)]) (out-anything name out) - (out-anything base out))] + (out-anything base out) + (unless (or name base) + (out-anything (module-path-index-submodule v) out)))] [(stx encoded) (out-byte CPT_STX out) (out-anything encoded out)] diff --git a/collects/compiler/zo-parse.rkt b/collects/compiler/zo-parse.rkt index 56c81345ed..4ddf836aab 100644 --- a/collects/compiler/zo-parse.rkt +++ b/collects/compiler/zo-parse.rkt @@ -840,7 +840,12 @@ (eq? cpt-tag 'let-one-unused))] [(branch) (make-branch (read-compact cp) (read-compact cp) (read-compact cp))] - [(module-index) (module-path-index-join (read-compact cp) (read-compact cp))] + [(module-index) + (define name (read-compact cp)) + (define base (read-compact cp)) + (if (or name base) + (module-path-index-join name base) + (module-path-index-join #f #f (read-compact cp)))] [(module-var) (let ([mod (read-compact cp)] [var (read-compact cp)]