diff --git a/LOG b/LOG index 34b29b2d69..19111aed18 100644 --- a/LOG +++ b/LOG @@ -1756,3 +1756,6 @@ argument-type-check error messages, for Windows multibyte->string and string->multibyte. primvars.ms +- used with-object-file to restore accidentally dropped close-port in + compile-whole-program and compile-whole-library + compile.ss diff --git a/s/compile.ss b/s/compile.ss index 4cc838ff53..44545d29ce 100644 --- a/s/compile.ss +++ b/s/compile.ss @@ -1495,21 +1495,20 @@ (define finish-compile (lambda (who msg ifn ofn hash-bang-line x1) - (let ([op ($open-file-output-port who ofn (file-options replace))]) - (on-reset (delete-file ofn #f) - (on-reset (close-port op) - (with-coverage-file who ofn - (lambda (source-table) - (when hash-bang-line (put-bytevector op hash-bang-line)) - (when (compile-compressed) (port-file-compressed! op)) - (parameterize ([$target-machine (constant machine-type-name)] - ; dummy sfd for block-profile optimization - [$sfd (make-source-file-descriptor ifn #xc7 #xc7c7)] - [$block-counter 0]) - (when source-table ($insert-profile-src! source-table x1)) - (emit-header op (constant machine-type)) - (let-values ([(rcinfo* final*) (compile-file-help1 x1 msg)]) - (compile-file-help2 op (list rcinfo*) (list final*))))))))))) + (with-object-file who ofn #f + (lambda (op) + (with-coverage-file who ofn + (lambda (source-table) + (when hash-bang-line (put-bytevector op hash-bang-line)) + (when (compile-compressed) (port-file-compressed! op)) + (parameterize ([$target-machine (constant machine-type-name)] + ; dummy sfd for block-profile optimization + [$sfd (make-source-file-descriptor ifn #xc7 #xc7c7)] + [$block-counter 0]) + (when source-table ($insert-profile-src! source-table x1)) + (emit-header op (constant machine-type)) + (let-values ([(rcinfo* final*) (compile-file-help1 x1 msg)]) + (compile-file-help2 op (list rcinfo*) (list final*)))))))))) (define write-wpo-file (lambda (who ofn ir*)