cs: check linklet imports when a procedure is expected
This commit is contained in:
parent
ab1b164982
commit
be6312314b
|
@ -859,7 +859,11 @@
|
|||
(when (eq? (variable-val var) variable-undefined)
|
||||
(raise-linking-failure "is uninitialized" target-inst inst sym))
|
||||
(let ([v (if import-abi
|
||||
(variable-val var)
|
||||
(let ([v (variable-val var)])
|
||||
(when (eq? import-abi 'proc)
|
||||
(unless (#%procedure? v)
|
||||
(raise-linking-failure "was expected to have a procedure value" target-inst inst sym)))
|
||||
v)
|
||||
var)])
|
||||
(cons v
|
||||
(extract-imported-variables target-inst inst (cdr syms) (cdr imports-abi) accum)))))]))
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -172,7 +172,13 @@
|
|||
(define im-ready? (import-group-lookup-ready? grp))
|
||||
(for/list ([im (in-list (import-group-imports grp))])
|
||||
(and im-ready?
|
||||
(known-constant? (import-group-lookup grp (import-ext-id im))))))
|
||||
(let ([k (import-group-lookup grp (import-ext-id im))])
|
||||
(and (known-constant? k)
|
||||
(if (known-procedure? k)
|
||||
;; A call to the procedure is probably in unsafe form:
|
||||
'proc
|
||||
;; Otherwise, accept any value:
|
||||
#t))))))
|
||||
;; Convert internal to external identifiers for known-value info
|
||||
(for/fold ([knowns (hasheq)]) ([ex-id (in-list ex-ids)])
|
||||
(define id (ex-int-id ex-id))
|
||||
|
|
Loading…
Reference in New Issue
Block a user