diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-07-17 13:35:51 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-07-17 13:35:51 +0000 |
commit | 6d4ff0d2f86d3c242b3f29bee3c2734df9ab8a3a (patch) | |
tree | 214aad99b5b3c414ccc9a349a7aacbdda3b96649 /pp_hot.c | |
parent | c03294656c9980c235cc5951a63088fd96d33704 (diff) | |
download | perl-6d4ff0d2f86d3c242b3f29bee3c2734df9ab8a3a.tar.gz |
Fix multiple problems with lexical @_.
p4raw-id: //depot/perl@39
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 38 |
1 files changed, 32 insertions, 6 deletions
@@ -2024,8 +2024,14 @@ PP(pp_entersub) /* Need to copy @_ to stack. Alternative may be to * switch stack to @_, and copy return values * back. This would allow popping @_ in XSUB, e.g.. XXXX */ - AV* av = GvAV(defgv); - I32 items = AvFILL(av) + 1; + AV* av; + I32 items; +#ifdef USE_THREADS + av = (AV*)curpad[0]; +#else + av = GvAV(defgv); +#endif /* USE_THREADS */ + items = AvFILL(av) + 1; if (items) { /* Mark is at the end of the stack. */ @@ -2110,19 +2116,39 @@ PP(pp_entersub) svp = AvARRAY(padlist); } } - SAVESPTR(curpad); - curpad = AvARRAY((AV*)svp[CvDEPTH(cv)]); - if (hasargs) { +#ifdef USE_THREADS + if (!hasargs) { AV* av = (AV*)curpad[0]; + + items = AvFILL(av) + 1; + if (items) { + /* Mark is at the end of the stack. */ + EXTEND(sp, items); + Copy(AvARRAY(av), sp + 1, items, SV*); + sp += items; + PUTBACK ; + } + } +#endif /* USE_THREADS */ + SAVESPTR(curpad); + curpad = AvARRAY((AV*)svp[CvDEPTH(cv)]); +#ifndef USE_THREADS + if (hasargs) +#endif /* USE_THREADS */ + { + AV* av; SV** ary; + av = (AV*)curpad[0]; if (AvREAL(av)) { av_clear(av); AvREAL_off(av); } +#ifndef USE_THREADS cx->blk_sub.savearray = GvAV(defgv); - cx->blk_sub.argarray = av; GvAV(defgv) = (AV*)SvREFCNT_inc(av); +#endif /* USE_THREADS */ + cx->blk_sub.argarray = av; ++MARK; if (items > AvMAX(av) + 1) { |