[MacRuby] #723: bug when calling the same variadic method multiple times with different arity

MacRuby ruby-noreply at macosforge.org
Tue Aug 31 15:51:49 PDT 2010


#723: bug when calling the same variadic method multiple times with different
arity
-----------------------------------+----------------------------------------
 Reporter:  jakub.suder@…          |       Owner:  lsansonetti@…        
     Type:  defect                 |      Status:  new                  
 Priority:  major                  |   Milestone:                       
Component:  MacRuby                |    Keywords:  0.7-blocker          
-----------------------------------+----------------------------------------

Comment(by martinlagardette@…):

 As discussed, this is because the whole project needs to be recompiled.

 However, it spec:ci only works if I use `< argc` instead of `!= argc` (see
 below), which seems "lucky", which is why I'll investigate a little more.

 {{{
 #!diff
 Index: vm.h
 ===================================================================
 --- vm.h (revision 4468)
 +++ vm.h (working copy)
 @@ -556,6 +556,7 @@
          } rcall;
          struct {
              IMP imp;
 +            int argc;
              bs_element_method_t *bs_method;
              rb_vm_objc_stub_t *stub;
          } ocall;
 Index: dispatcher.cpp
 ===================================================================
 --- dispatcher.cpp (revision 4468)
 +++ dispatcher.cpp (working copy)
 @@ -501,6 +501,7 @@
      cache->sel = sel;
      cache->klass = klass;
      cache->as.ocall.imp = imp;
 +    cache->as.ocall.argc = argc;
      cache->as.ocall.bs_method = GET_CORE()->find_bs_method(klass, sel);

      char types[200];
 @@ -829,6 +830,9 @@
          return v;
      }
      else if (cache->flag & MCACHE_OCALL) {
 +        if (cache->as.ocall.argc < argc) {
 +            goto recache;
 +        }
          if (!cache_method) {
              cache->flag = 0;
          }

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/723#comment:10>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list