Ticket #573: netbsd-alpha-valist.patch

File netbsd-alpha-valist.patch, 1.3 KB (added by Infinoid, 13 years ago)

New patch implementing allison++'s suggestion. Needs testing, should hopefully get it building a little farther.

  • src/pmc/class.pmc

    commit da38366960d4d25b3dfbf47220ab8129392cc130
    Author: Mark Glines <mark@glines.org>
    Date:   Wed Apr 22 09:40:10 2009 -0700
    
        [netbsd] netbsd-alpha fails to compile due to passing NULL in place of a va_list argument.
        va_list is not always a pointer type, this is not a requirement of C89.
        
        This patch implements allison++'s suggestion to more cleanly build a null CallSignature object.
    
    diff --git a/src/pmc/class.pmc b/src/pmc/class.pmc
    index f8890d9..e520486 100644
    a b  
    335335        meth = Parrot_oo_find_vtable_override_for_class(interp, parent, name); 
    336336 
    337337        if (!PMC_IS_NULL(meth)) { 
    338             PMC *sig_obj = Parrot_pcc_build_sig_object_from_varargs(interp, object, "->", NULL); 
     338            /* build an empty signature; it has an invocant but no args/retvals */ 
     339            PMC *sig_obj = pmc_new(interp, enum_class_CallSignature); 
     340            VTABLE_set_string_native(interp, sig_obj, CONST_STRING(interp, "Pi->")); 
     341            /* add the invocant */ 
     342            VTABLE_unshift_pmc(interp, sig_obj, object); 
    339343            Parrot_pcc_invoke_from_sig_object(interp, meth, sig_obj); 
    340344            gc_unregister_pmc(interp, sig_obj); 
    341345        }