summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-04-03 06:59:37 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-04-03 06:59:37 +0000
commite336de0d01f30cc4061b6d6a00d11df30fc67cd3 (patch)
tree47af4eae88807f461d216a10701a0502a2373226 /scope.c
parentdfb1c8b93631b1cf8c1d0d2295ffff2bf0f098a7 (diff)
downloadperl-e336de0d01f30cc4061b6d6a00d11df30fc67cd3.tar.gz
[win32] implement stack-of-stacks so that magic invocations don't
invalidate local stack pointer p4raw-id: //depot/win32/perl@864
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index f1a0b6ff09..8d6ee701d0 100644
--- a/scope.c
+++ b/scope.c
@@ -42,6 +42,26 @@ stack_grow(SV **sp, SV **p, int n)
#define GROW(old) ((old) + 1)
#endif
+PERL_SI *
+new_stackinfo(I32 stitems, I32 cxitems)
+{
+ PERL_SI *si;
+ PERL_CONTEXT *cxt;
+ New(56, si, 1, PERL_SI);
+ si->si_stack = newAV();
+ AvREAL_off(si->si_stack);
+ av_extend(si->si_stack, stitems > 0 ? stitems-1 : 0);
+ AvALLOC(si->si_stack)[0] = &sv_undef;
+ AvFILLp(si->si_stack) = 0;
+ si->si_prev = 0;
+ si->si_next = 0;
+ si->si_cxmax = cxitems - 1;
+ si->si_cxix = -1;
+ si->si_type = SI_UNDEF;
+ New(56, si->si_cxstack, cxitems, PERL_CONTEXT);
+ return si;
+}
+
I32
cxinc(void)
{