ffi/unsafe/objc: fix selector definition lifting

The code intended to lift each selector only once (per lifting
context) was broken.
This commit is contained in:
Matthew Flatt 2013-07-31 17:16:27 -06:00
parent c137b44a68
commit e5e6d097be

View File

@ -390,10 +390,11 @@
(define-for-syntax method-sels (make-hash))
(define-for-syntax (register-selector sym)
(or (hash-ref method-sels (cons (syntax-local-lift-context) sym) #f)
(define key (cons (syntax-local-lift-context) sym))
(or (hash-ref method-sels key #f)
(let ([id (syntax-local-lift-expression
#`(sel_registerName #,(symbol->string sym)))])
(hash-set! method-sels sym id)
(hash-set! method-sels key id)
id)))
(provide selector)