chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #584: Unused arguments in callback wrappers are incor


From: Chicken Trac
Subject: [Chicken-janitors] #584: Unused arguments in callback wrappers are incorrectly optimized away
Date: Sun, 29 May 2011 14:27:07 -0000

#584: Unused arguments in callback wrappers are incorrectly optimized away
-------------------------------------------------+--------------------------
 Reporter:  sjamaan                              |       Owner:  felix
     Type:  defect                               |      Status:  new  
 Priority:  critical                             |   Milestone:  4.8.0
Component:  compiler                             |     Version:  4.6.x
 Keywords:  optimizations, define-external, ffi  |  
-------------------------------------------------+--------------------------
 {{{
 (module bla (foo)

 (import chicken scheme foreign)

 (define-external
   (blabla (int a) (c-string b) (int c) (int d) (c-string e) (int f))
   void
   (print "HELLO"))

 (define (foo) ((foreign-safe-lambda* void () "blabla(1, \"2\", 3, 4,
 \"5\", 6);")))
 )

 (import bla)
 (foo)
 }}}

 This gives an error:

 {{{
 Error: bad argument count - received 6 but expected 2: #<procedure>

         Call history:

         test.scm:14: bla#foo
         ##sys#gc
         g2728           <--
 }}}

 This is caused by the fact that {{{callback-names}}} contains the
 unqualified procedure name (not prefixed with a module name).

 Attached is a patch that seems to fix this (but I'm not 100% sure if it's
 the Right Way(TM) of fixing this).

 I think there may be other bugs like this where the raw symbol is inserted
 into some database while it should be using the qualified name, so it's
 probably a good idea to review other parts of the optimizer.

 PS: The milestone 4.7.0 was reached, it should be closed in Trac and the
 Version dropdown should be changed to include 4.7.0

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/584>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]