fix guard on references to unsafe functions in bytecode
The protection against unsafe-function references was designed for
bytecode that referred to unsafe operations indirectly, and that
was broken when the compiler changed to refer to unsafe functions
directly in bytecode (to simplify JIT inlining bytecode optimization).
Actually, the relevant code (now removed) seems to be pointless,
since protected-binding checking should cover it already. Maybe
something else changed, or maybe the code was not properly checked
in the first place.
Now, `read` rejects a bytecode stream if it contains a direct
reference to an unsafe function and the code inspector is not the
original code inspector. It's still possible to synthesize bytecode
that contains an indirect reference, and then protected-binding
checking does its job.
original commit: 7ccac3c054
This commit is contained in:
parent
c66558badb
commit
9ac14af3fc
|
@ -67,13 +67,10 @@
|
|||
(make-compilation-top ld prefix code)]))
|
||||
|
||||
(define (read-resolve-prefix v)
|
||||
(let-values ([(v unsafe?) (if (integer? (car v))
|
||||
(values v #f)
|
||||
(values (cdr v) #t))])
|
||||
(match v
|
||||
[`(,i ,tv . ,sv)
|
||||
; XXX Why not leave them as vectors and change the contract?
|
||||
(make-prefix i (vector->list tv) (vector->list sv))])))
|
||||
;; XXX Why not leave them as vectors and change the contract?
|
||||
(make-prefix i (vector->list tv) (vector->list sv))]))
|
||||
|
||||
(define read-free-id-info
|
||||
(match-lambda
|
||||
|
|
Loading…
Reference in New Issue
Block a user