chicken-janitors
[Top][All Lists]
Advanced

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

Re: #1703: Arguments being passed to procedure incorrectly


From: Chicken Trac
Subject: Re: #1703: Arguments being passed to procedure incorrectly
Date: Fri, 04 Sep 2020 14:30:32 -0000

#1703: Arguments being passed to procedure incorrectly
----------------------------------------+----------------------
            Reporter:  Jakob L. Kreuze  |      Owner:  sjamaan
                Type:  defect           |     Status:  accepted
            Priority:  major            |  Milestone:  5.3
           Component:  compiler         |    Version:  5.2.0
          Resolution:                   |   Keywords:
Estimated difficulty:  hard             |
----------------------------------------+----------------------

Comment (by sjamaan):

 In CHICKEN 5.1.0, the function looks like this:

 {{{
 static void C_ccall f_147(C_word c,C_word *av){
 C_word tmp;
 C_word t0=av[0];
 C_word t1=av[1];
 C_word t2;
 C_word *a;
 C_check_for_interrupt;
 if(C_unlikely(!C_demand(C_calculate_demand((c-2)*C_SIZEOF_PAIR +0,c,3)))){
 C_save_and_reclaim((void*)f_147,c,av);}
 a=C_alloc((c-2)*C_SIZEOF_PAIR+0);
 t2=C_build_rest(&a,c,2,av);
 C_word t3;
 C_word t4;
 t3=C_i_car(t2); // Access got moved up, a new temporary is assigned.
 C_trace(C_text("test.scm:5: reduce"));
 {C_proc tp=(C_proc)C_fast_retrieve_proc(*((C_word*)lf[0]+1));
 C_word *av2;
 if(c >= 4) {
   av2=av;
 } else {
   av2=C_alloc(4);
 }
 av2[0]=*((C_word*)lf[0]+1);
 av2[1]=t1;
 av2[2]=t2;
 av2[3]=t3;
 tp(4,av2);}}
 }}}

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/1703#comment:6>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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