summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-03-07 07:51:28 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-03-07 07:51:28 +0000
commit3bd495df69b982704c59fc1ecbed71e5112e7da0 (patch)
tree47303adb4596ab4c7c0b981f50c0a72d52092338 /scope.c
parentfe9f1ed50ae7ad31787549184f98f0a71eda0191 (diff)
parent1d16519d77cbada019f865cb923236cd48a23c72 (diff)
downloadperl-3bd495df69b982704c59fc1ecbed71e5112e7da0.tar.gz
[win32] integrate mainline changes
p4raw-id: //depot/asperl@799
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c50
1 files changed, 42 insertions, 8 deletions
diff --git a/scope.c b/scope.c
index 56387e8b13..b1b7696248 100644
--- a/scope.c
+++ b/scope.c
@@ -433,6 +433,30 @@ save_delete(HV *hv, char *key, I32 klen)
}
void
+save_aelem(AV *av, I32 idx, SV **sptr)
+{
+ dTHR;
+ SSCHECK(4);
+ SSPUSHPTR(av);
+ SSPUSHINT(idx);
+ SSPUSHPTR(*sptr);
+ SSPUSHINT(SAVEt_AELEM);
+ save_scalar_at(sptr);
+}
+
+void
+save_helem(HV *hv, SV *key, SV **sptr)
+{
+ dTHR;
+ SSCHECK(4);
+ SSPUSHPTR(hv);
+ SSPUSHPTR(key);
+ SSPUSHPTR(*sptr);
+ SSPUSHINT(SAVEt_HELEM);
+ save_scalar_at(sptr);
+}
+
+void
save_list(register SV **sarg, I32 maxsarg)
{
dTHR;
@@ -482,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");
@@ -693,17 +718,26 @@ leave_scope(I32 base)
(CALLDESTRUCTOR)(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*)SSPOPPTR;
+ 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;