summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorStephen McCamant <smcc@mit.edu>1997-12-20 09:16:14 -0600
committerGurusamy Sarathy <gsar@cpan.org>1998-03-02 03:28:28 +0000
commit161b7d1635bc830b9c733355ab423626eadf9ae9 (patch)
treea4910bbe25ce9e9991920dbbf1c82792dfc950d8 /scope.c
parentf3ea7b5ee70397733e54550d64ca43f4288e744f (diff)
downloadperl-161b7d1635bc830b9c733355ab423626eadf9ae9.tar.gz
[win32] this one with adjusted test numbers
Message-Id: <m0xjWFq-000EZeC@alias-2.pr.mcs.net> Subject: [PERL] [PATCH] Fix local $a[0] and local $h{a} p4raw-id: //depot/win32/perl@614
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c54
1 files changed, 46 insertions, 8 deletions
diff --git a/scope.c b/scope.c
index 8a7d0ce5f8..33569dacf4 100644
--- a/scope.c
+++ b/scope.c
@@ -434,6 +434,34 @@ save_delete(HV *hv, char *key, I32 klen)
void
save_list(register SV **sarg, I32 maxsarg)
+save_aelem(av,idx,sptr)
+AV *av;
+I32 idx;
+SV **sptr;
+{
+ SSCHECK(4);
+ SSPUSHPTR(av);
+ SSPUSHINT(idx);
+ SSPUSHPTR(*sptr);
+ SSPUSHINT(SAVEt_AELEM);
+ save_scalar_at(sptr);
+}
+
+void
+save_helem(hv,key,sptr)
+HV *hv;
+SV *key;
+SV **sptr;
+{
+ SSCHECK(4);
+ SSPUSHPTR(hv);
+ SSPUSHPTR(key);
+ SSPUSHPTR(*sptr);
+ SSPUSHINT(SAVEt_HELEM);
+ save_scalar_at(sptr);
+}
+
+void
{
dTHR;
register SV *sv;
@@ -478,6 +506,7 @@ leave_scope(I32 base)
register AV *av;
register HV *hv;
register void* ptr;
+ I32 i;
if (base < -1)
croak("panic: corrupt saved stack index");
@@ -689,17 +718,26 @@ leave_scope(I32 base)
(*SSPOPDPTR)(ptr);
break;
case SAVEt_REGCONTEXT:
- {
- I32 delta = SSPOPINT;
- savestack_ix -= delta; /* regexp must have croaked */
- }
+ i = SSPOPINT;
+ savestack_ix -= i; /* regexp must have croaked */
break;
case SAVEt_STACK_POS: /* Position on Perl stack */
- {
- I32 delta = SSPOPINT;
- stack_sp = stack_base + delta;
- }
+ i = SSPOPINT;
+ stack_sp = stack_base + i;
break;
+ case SAVEt_AELEM: /* array element */
+ value = (SV*)SSPOPPTR;
+ i = SSPOPINT;
+ av = (AV*)SSPOPPTR;
+ ptr = av_fetch(av,i,1);
+ goto restore_sv;
+ case SAVEt_HELEM: /* hash element */
+ value = (SV*)SSPOPPTR;
+ sv = (SV*)SSPOPINT;
+ hv = (HV*)SSPOPPTR;
+ ptr = hv_fetch_ent(hv, sv, 1, 0);
+ ptr = &HeVAL((HE*)ptr);
+ goto restore_sv;
case SAVEt_OP:
op = (OP*)SSPOPPTR;
break;