diff options
author | Albert Dvornik <bert@genscan.com> | 1998-06-24 15:33:09 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-06-29 05:09:24 +0000 |
commit | 1fa4e549f8e9f3cede7f12d9227a009e3b2383d9 (patch) | |
tree | 6c3163656394a5946b0bec4b2db8b748aa323070 /pp_ctl.c | |
parent | 4d8e958134796df34602e5e9cd681a03e196ab86 (diff) | |
download | perl-1fa4e549f8e9f3cede7f12d9227a009e3b2383d9.tar.gz |
applied patch, tweak for threads awareness
Subject: [PATCH]5.004_04-m4 (CORE) fix for broken "goto &xsub"
Message-Id: <tq4sxawf2h.fsf@puma.genscan.com>
p4raw-id: //depot/perl@1257
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -1777,6 +1777,20 @@ PP(pp_goto) AvREAL_off(av); av_clear(av); } + else if (CvXSUB(cv)) { /* put GvAV(defgv) back onto stack */ + AV* av; + int i; +#ifdef USE_THREADS + av = (AV*)curpad[0]; +#else + av = GvAV(defgv); +#endif + items = AvFILLp(av) + 1; + stack_sp++; + EXTEND(stack_sp, items); /* @_ could have been extended. */ + Copy(AvARRAY(av), stack_sp, items, SV*); + stack_sp += items; + } if (cx->cx_type == CXt_SUB && !(CvDEPTH(cx->blk_sub.cv) = cx->blk_sub.olddepth)) SvREFCNT_dec(cx->blk_sub.cv); @@ -1799,8 +1813,16 @@ PP(pp_goto) SP = stack_base + items; } else { + SV **newsp; + I32 gimme; + stack_sp--; /* There is no cv arg. */ + /* Push a mark for the start of arglist */ + PUSHMARK(mark); (void)(*CvXSUB(cv))(cv _PERL_OBJECT_THIS); + /* Pop the current context like a decent sub should */ + POPBLOCK(cx, curpm); + /* Do _not_ use PUTBACK, keep the XSUB's return stack! */ } LEAVE; return pop_return(); |