From e5e6d097bedb526d97f3dc12675a95d11dc376cf Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 31 Jul 2013 17:16:27 -0600 Subject: [PATCH] ffi/unsafe/objc: fix selector definition lifting The code intended to lift each selector only once (per lifting context) was broken. --- racket/collects/ffi/unsafe/objc.rkt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/racket/collects/ffi/unsafe/objc.rkt b/racket/collects/ffi/unsafe/objc.rkt index 350ed2a580..c283116309 100644 --- a/racket/collects/ffi/unsafe/objc.rkt +++ b/racket/collects/ffi/unsafe/objc.rkt @@ -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)