Changeset 3938 for src/perl5

Show
Ignore:
Timestamp:
05/27/05 02:25:26 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
5515
Message:

* all should work except this memory overflow thing

Location:
src/perl5
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • src/perl5/perl5.c

    r3937 r3938  
    202202 
    203203SV * 
    204 perl5_call(char *subname, int argc, SV** args, SV *env, int cxt) 
    205 { 
    206     int i; 
    207     SV *rv, *sv; 
     204perl5_apply(SV *sub, SV *inv, SV** args, SV *env, int cxt) 
     205{ 
     206    SV *arg; 
     207    SV *rv; 
     208    SV *sv; 
    208209 
    209210    dSP; 
     
    219220 
    220221    PUSHMARK(SP); 
    221     for (i = 0; i < argc; i++) { 
    222         XPUSHs(args[i]); 
    223     } 
    224     PUTBACK; 
    225  
    226     call_method(subname, cxt); 
     222    if (inv != NULL) { 
     223        XPUSHs(inv); 
     224    } 
     225    for (arg = args; arg != NULL; arg++) { 
     226        XPUSHs(arg); 
     227    } 
     228    PUTBACK; 
     229 
     230    if (inv != NULL) { 
     231        call_method(SvPV_nolen(sub), cxt); 
     232    } 
     233    else { 
     234        call_sv(sub, cxt); 
     235    } 
    227236 
    228237    SPAGAIN; 
  • src/perl5/perl5.h

    r3936 r3938  
    1111SV * perl5_newSViv ( int iv ); 
    1212SV * perl5_newSVnv ( double iv ); 
    13 SV * perl5_call(char *subname, int argc, SV** args, SV *env, int cxt); 
     13SV * perl5_apply(SV *sub, SV *inv, SV** args, SV *env, int cxt); 
    1414bool perl5_can(SV *inv, char *subname); 
    1515SV * perl5_eval(char *code, SV *env, int cxt); 
  • src/perl5/pugsembed.c

    r3937 r3938  
    2626    if (__init && pugs_ValToIv(pugs_Apply(pugs_PvToVal("&isa"), val, isa))) { 
    2727        fprintf(stderr, "got a code!!\n"); 
    28         stack[0] = newSVpv("pugs::guts", 0); 
    29         stack[1] = sv; 
    30         sv = perl5_call("code", 2, stack, NULL, G_SCALAR); 
     28        stack[0] = sv; 
     29        sv = perl5_apply(newSVpv("code", 0), newSVpv("pugs::guts", 0), stack, NULL, G_SCALAR); 
    3130    } 
    3231    return (sv);