close port in compile-whole-program and compile-whole-library
original commit: ed4b7cff2e075c1da0880fc5e2f4491503f9f031
This commit is contained in:
parent
899a688bb0
commit
6ba371fb8d
3
LOG
3
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
|
||||
|
|
29
s/compile.ss
29
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*)
|
||||
|
|
Loading…
Reference in New Issue
Block a user