This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[shell changes from patch from perl5.003_18 to perl5.003_19]
[perl5.git] / scope.c
CommitLineData
a0d0e21e 1/* scope.c
79072805 2 *
a0d0e21e 3 * Copyright (c) 1991-1994, Larry Wall
79072805
LW
4 *
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
7 *
a0d0e21e
LW
8 */
9
10/*
11 * "For the fashion of Minas Tirith was such that it was built on seven
12 * levels..."
79072805
LW
13 */
14
15#include "EXTERN.h"
16#include "perl.h"
17
a0d0e21e
LW
18SV**
19stack_grow(sp, p, n)
20SV** sp;
21SV** p;
22int n;
23{
24 stack_sp = sp;
1f96a9ed 25 av_extend(curstack, (p - stack_base) + (n) + 128);
a0d0e21e
LW
26 return stack_sp;
27}
28
79072805
LW
29I32
30cxinc()
31{
32 cxstack_max = cxstack_max * 3 / 2;
a38d6535 33 Renew(cxstack, cxstack_max + 1, CONTEXT); /* XXX should fix CXINC macro */
79072805
LW
34 return cxstack_ix + 1;
35}
36
37void
38push_return(retop)
39OP *retop;
40{
41 if (retstack_ix == retstack_max) {
42 retstack_max = retstack_max * 3 / 2;
43 Renew(retstack, retstack_max, OP*);
44 }
45 retstack[retstack_ix++] = retop;
46}
47
48OP *
49pop_return()
50{
51 if (retstack_ix > 0)
52 return retstack[--retstack_ix];
53 else
54 return Nullop;
55}
56
57void
58push_scope()
59{
60 if (scopestack_ix == scopestack_max) {
61 scopestack_max = scopestack_max * 3 / 2;
62 Renew(scopestack, scopestack_max, I32);
63 }
64 scopestack[scopestack_ix++] = savestack_ix;
65
66}
67
68void
69pop_scope()
70{
71 I32 oldsave = scopestack[--scopestack_ix];
8990e307 72 LEAVE_SCOPE(oldsave);
79072805
LW
73}
74
75void
a0d0e21e
LW
76markstack_grow()
77{
78 I32 oldmax = markstack_max - markstack;
79 I32 newmax = oldmax * 3 / 2;
80
81 Renew(markstack, newmax, I32);
82 markstack_ptr = markstack + oldmax;
83 markstack_max = markstack + newmax;
84}
85
86void
79072805
LW
87savestack_grow()
88{
89 savestack_max = savestack_max * 3 / 2;
90 Renew(savestack, savestack_max, ANY);
91}
92
93void
94free_tmps()
95{
96 /* XXX should tmps_floor live in cxstack? */
97 I32 myfloor = tmps_floor;
98 while (tmps_ix > myfloor) { /* clean up after last statement */
99 SV* sv = tmps_stack[tmps_ix];
100 tmps_stack[tmps_ix--] = Nullsv;
463ee0b2
LW
101 if (sv) {
102#ifdef DEBUGGING
103 SvTEMP_off(sv);
104#endif
8990e307 105 SvREFCNT_dec(sv); /* note, can modify tmps_ix!!! */
463ee0b2 106 }
79072805
LW
107 }
108}
109
7a4c00b4
PP
110static SV *
111save_scalar_at(sptr)
112SV **sptr;
79072805
LW
113{
114 register SV *sv;
7a4c00b4 115 SV *osv = *sptr;
79072805 116
7a4c00b4 117 sv = *sptr = NEWSV(0,0);
a0d0e21e 118 if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(osv) && SvTYPE(osv) != SVt_PVGV) {
79072805 119 sv_upgrade(sv, SvTYPE(osv));
a0d0e21e 120 if (SvGMAGICAL(osv)) {
748a9306
LW
121 MAGIC* mg;
122 bool oldtainted = tainted;
a0d0e21e 123 mg_get(osv);
748a9306
LW
124 if (tainting && tainted && (mg = mg_find(osv, 't'))) {
125 SAVESPTR(mg->mg_obj);
126 mg->mg_obj = osv;
127 }
a0d0e21e
LW
128 SvFLAGS(osv) |= (SvFLAGS(osv) &
129 (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
748a9306 130 tainted = oldtainted;
a0d0e21e 131 }
79072805 132 SvMAGIC(sv) = SvMAGIC(osv);
a0d0e21e 133 SvFLAGS(sv) |= SvMAGICAL(osv);
748a9306 134 localizing = 1;
79072805 135 SvSETMAGIC(sv);
748a9306 136 localizing = 0;
79072805
LW
137 }
138 return sv;
139}
140
7a4c00b4
PP
141SV *
142save_scalar(gv)
143GV *gv;
144{
145 SSCHECK(3);
146 SSPUSHPTR(gv);
147 SSPUSHPTR(GvSV(gv));
148 SSPUSHINT(SAVEt_SV);
149 return save_scalar_at(&GvSV(gv));
150}
151
152SV*
153save_svref(sptr)
154SV **sptr;
155{
156 SSCHECK(3);
157 SSPUSHPTR(sptr);
158 SSPUSHPTR(*sptr);
159 SSPUSHINT(SAVEt_SVREF);
160 return save_scalar_at(sptr);
161}
162
79072805 163void
5f05dabc 164save_gp(gv, empty)
79072805 165GV *gv;
5f05dabc 166I32 empty;
79072805 167{
79072805 168 SSCHECK(3);
4633a7c4 169 SSPUSHPTR(SvREFCNT_inc(gv));
5f05dabc 170 SSPUSHPTR(GvGP(gv));
79072805
LW
171 SSPUSHINT(SAVEt_GP);
172
5f05dabc
PP
173 if (empty) {
174 register GP *gp;
175 Newz(602, gp, 1, GP);
176 GvGP(gv) = gp;
177 GvREFCNT(gv) = 1;
178 GvSV(gv) = NEWSV(72,0);
179 GvLINE(gv) = curcop->cop_line;
180 GvEGV(gv) = gv;
181 }
182 else {
183 GvGP(gv)->gp_refcnt++;
184 GvINTRO_on(gv);
185 }
79072805 186}
79072805 187
79072805
LW
188AV *
189save_ary(gv)
190GV *gv;
191{
192 SSCHECK(3);
193 SSPUSHPTR(gv);
194 SSPUSHPTR(GvAVn(gv));
195 SSPUSHINT(SAVEt_AV);
196
197 GvAV(gv) = Null(AV*);
198 return GvAVn(gv);
199}
200
201HV *
202save_hash(gv)
203GV *gv;
204{
205 SSCHECK(3);
206 SSPUSHPTR(gv);
207 SSPUSHPTR(GvHVn(gv));
208 SSPUSHINT(SAVEt_HV);
209
210 GvHV(gv) = Null(HV*);
211 return GvHVn(gv);
212}
213
214void
215save_item(item)
216register SV *item;
217{
218 register SV *sv;
219
220 SSCHECK(3);
221 SSPUSHPTR(item); /* remember the pointer */
222 sv = NEWSV(0,0);
223 sv_setsv(sv,item);
224 SSPUSHPTR(sv); /* remember the value */
225 SSPUSHINT(SAVEt_ITEM);
226}
227
228void
229save_int(intp)
230int *intp;
231{
232 SSCHECK(3);
233 SSPUSHINT(*intp);
234 SSPUSHPTR(intp);
235 SSPUSHINT(SAVEt_INT);
236}
237
238void
85e6fe83
LW
239save_long(longp)
240long *longp;
241{
242 SSCHECK(3);
243 SSPUSHLONG(*longp);
244 SSPUSHPTR(longp);
245 SSPUSHINT(SAVEt_LONG);
246}
247
248void
79072805
LW
249save_I32(intp)
250I32 *intp;
251{
252 SSCHECK(3);
253 SSPUSHINT(*intp);
254 SSPUSHPTR(intp);
255 SSPUSHINT(SAVEt_I32);
256}
257
a0d0e21e 258void
55497cff
PP
259save_I16(intp)
260I16 *intp;
261{
262 SSCHECK(3);
263 SSPUSHINT(*intp);
264 SSPUSHPTR(intp);
265 SSPUSHINT(SAVEt_I16);
266}
267
268void
a0d0e21e
LW
269save_iv(ivp)
270IV *ivp;
271{
272 SSCHECK(3);
4aa0a1f7 273 SSPUSHIV(*ivp);
a0d0e21e
LW
274 SSPUSHPTR(ivp);
275 SSPUSHINT(SAVEt_IV);
276}
277
85e6fe83
LW
278/* Cannot use save_sptr() to store a char* since the SV** cast will
279 * force word-alignment and we'll miss the pointer.
280 */
281void
282save_pptr(pptr)
283char **pptr;
284{
285 SSCHECK(3);
286 SSPUSHPTR(*pptr);
287 SSPUSHPTR(pptr);
288 SSPUSHINT(SAVEt_PPTR);
289}
290
79072805
LW
291void
292save_sptr(sptr)
293SV **sptr;
294{
295 SSCHECK(3);
296 SSPUSHPTR(*sptr);
297 SSPUSHPTR(sptr);
298 SSPUSHINT(SAVEt_SPTR);
299}
300
301void
302save_nogv(gv)
303GV *gv;
304{
305 SSCHECK(2);
306 SSPUSHPTR(gv);
307 SSPUSHINT(SAVEt_NSTAB);
308}
309
310void
311save_hptr(hptr)
312HV **hptr;
313{
314 SSCHECK(3);
85e6fe83 315 SSPUSHPTR(*hptr);
79072805
LW
316 SSPUSHPTR(hptr);
317 SSPUSHINT(SAVEt_HPTR);
318}
319
320void
321save_aptr(aptr)
322AV **aptr;
323{
324 SSCHECK(3);
85e6fe83 325 SSPUSHPTR(*aptr);
79072805
LW
326 SSPUSHPTR(aptr);
327 SSPUSHINT(SAVEt_APTR);
328}
329
330void
8990e307
LW
331save_freesv(sv)
332SV *sv;
333{
334 SSCHECK(2);
335 SSPUSHPTR(sv);
336 SSPUSHINT(SAVEt_FREESV);
337}
338
339void
340save_freeop(op)
341OP *op;
342{
343 SSCHECK(2);
344 SSPUSHPTR(op);
345 SSPUSHINT(SAVEt_FREEOP);
346}
347
348void
349save_freepv(pv)
350char *pv;
351{
352 SSCHECK(2);
353 SSPUSHPTR(pv);
354 SSPUSHINT(SAVEt_FREEPV);
355}
356
357void
358save_clearsv(svp)
359SV** svp;
360{
361 SSCHECK(2);
4aa0a1f7 362 SSPUSHLONG((long)(svp-curpad));
8990e307
LW
363 SSPUSHINT(SAVEt_CLEARSV);
364}
365
366void
367save_delete(hv,key,klen)
368HV *hv;
369char *key;
370I32 klen;
371{
372 SSCHECK(4);
373 SSPUSHINT(klen);
374 SSPUSHPTR(key);
375 SSPUSHPTR(hv);
376 SSPUSHINT(SAVEt_DELETE);
377}
378
379void
79072805
LW
380save_list(sarg,maxsarg)
381register SV **sarg;
382I32 maxsarg;
383{
384 register SV *sv;
385 register I32 i;
386
387 SSCHECK(3 * maxsarg);
388 for (i = 1; i <= maxsarg; i++) {
389 SSPUSHPTR(sarg[i]); /* remember the pointer */
390 sv = NEWSV(0,0);
391 sv_setsv(sv,sarg[i]);
392 SSPUSHPTR(sv); /* remember the value */
393 SSPUSHINT(SAVEt_ITEM);
394 }
395}
396
397void
a0d0e21e
LW
398save_destructor(f,p)
399void (*f) _((void*));
400void* p;
401{
402 SSCHECK(3);
403 SSPUSHDPTR(f);
404 SSPUSHPTR(p);
405 SSPUSHINT(SAVEt_DESTRUCTOR);
406}
407
408void
79072805
LW
409leave_scope(base)
410I32 base;
411{
412 register SV *sv;
413 register SV *value;
414 register GV *gv;
415 register AV *av;
416 register HV *hv;
417 register void* ptr;
418
419 if (base < -1)
463ee0b2 420 croak("panic: corrupt saved stack index");
79072805
LW
421 while (savestack_ix > base) {
422 switch (SSPOPINT) {
423 case SAVEt_ITEM: /* normal string */
424 value = (SV*)SSPOPPTR;
425 sv = (SV*)SSPOPPTR;
426 sv_replace(sv,value);
748a9306 427 localizing = 2;
79072805 428 SvSETMAGIC(sv);
748a9306 429 localizing = 0;
79072805
LW
430 break;
431 case SAVEt_SV: /* scalar reference */
432 value = (SV*)SSPOPPTR;
433 gv = (GV*)SSPOPPTR;
7a4c00b4
PP
434 ptr = &GvSV(gv);
435 goto restore_sv;
79072805 436 case SAVEt_SVREF: /* scalar reference */
7a4c00b4 437 value = (SV*)SSPOPPTR;
79072805 438 ptr = SSPOPPTR;
7a4c00b4 439 restore_sv:
79072805 440 sv = *(SV**)ptr;
748a9306
LW
441 if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv) &&
442 SvTYPE(sv) != SVt_PVGV)
443 {
a0d0e21e
LW
444 (void)SvUPGRADE(value, SvTYPE(sv));
445 SvMAGIC(value) = SvMAGIC(sv);
446 SvFLAGS(value) |= SvMAGICAL(sv);
447 SvMAGICAL_off(sv);
79072805 448 SvMAGIC(sv) = 0;
a0d0e21e 449 }
7a4c00b4
PP
450 else if (SvTYPE(value) >= SVt_PVMG && SvMAGIC(value) &&
451 SvTYPE(value) != SVt_PVGV)
452 {
453 SvFLAGS(value) |= (SvFLAGS(value) &
454 (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
455 SvMAGICAL_off(value);
456 SvMAGIC(value) = 0;
457 }
8990e307 458 SvREFCNT_dec(sv);
a0d0e21e 459 *(SV**)ptr = value;
748a9306 460 localizing = 2;
a0d0e21e 461 SvSETMAGIC(value);
748a9306 462 localizing = 0;
79072805
LW
463 break;
464 case SAVEt_AV: /* array reference */
465 av = (AV*)SSPOPPTR;
466 gv = (GV*)SSPOPPTR;
8990e307 467 SvREFCNT_dec(GvAV(gv));
79072805
LW
468 GvAV(gv) = av;
469 break;
470 case SAVEt_HV: /* hash reference */
471 hv = (HV*)SSPOPPTR;
472 gv = (GV*)SSPOPPTR;
8990e307 473 SvREFCNT_dec(GvHV(gv));
79072805
LW
474 GvHV(gv) = hv;
475 break;
476 case SAVEt_INT: /* int reference */
477 ptr = SSPOPPTR;
478 *(int*)ptr = (int)SSPOPINT;
479 break;
85e6fe83
LW
480 case SAVEt_LONG: /* long reference */
481 ptr = SSPOPPTR;
482 *(long*)ptr = (long)SSPOPLONG;
483 break;
79072805
LW
484 case SAVEt_I32: /* I32 reference */
485 ptr = SSPOPPTR;
486 *(I32*)ptr = (I32)SSPOPINT;
487 break;
55497cff
PP
488 case SAVEt_I16: /* I16 reference */
489 ptr = SSPOPPTR;
490 *(I16*)ptr = (I16)SSPOPINT;
491 break;
a0d0e21e
LW
492 case SAVEt_IV: /* IV reference */
493 ptr = SSPOPPTR;
494 *(IV*)ptr = (IV)SSPOPIV;
495 break;
79072805
LW
496 case SAVEt_SPTR: /* SV* reference */
497 ptr = SSPOPPTR;
498 *(SV**)ptr = (SV*)SSPOPPTR;
499 break;
85e6fe83
LW
500 case SAVEt_PPTR: /* char* reference */
501 ptr = SSPOPPTR;
502 *(char**)ptr = (char*)SSPOPPTR;
503 break;
79072805
LW
504 case SAVEt_HPTR: /* HV* reference */
505 ptr = SSPOPPTR;
506 *(HV**)ptr = (HV*)SSPOPPTR;
507 break;
508 case SAVEt_APTR: /* AV* reference */
509 ptr = SSPOPPTR;
510 *(AV**)ptr = (AV*)SSPOPPTR;
511 break;
512 case SAVEt_NSTAB:
513 gv = (GV*)SSPOPPTR;
1f96a9ed 514 (void)sv_clear((SV*)gv);
79072805
LW
515 break;
516 case SAVEt_GP: /* scalar reference */
517 ptr = SSPOPPTR;
518 gv = (GV*)SSPOPPTR;
519 gp_free(gv);
520 GvGP(gv) = (GP*)ptr;
4633a7c4 521 SvREFCNT_dec(gv);
79072805 522 break;
8990e307
LW
523 case SAVEt_FREESV:
524 ptr = SSPOPPTR;
525 SvREFCNT_dec((SV*)ptr);
526 break;
527 case SAVEt_FREEOP:
528 ptr = SSPOPPTR;
529 curpad = AvARRAY(comppad);
530 op_free((OP*)ptr);
531 break;
532 case SAVEt_FREEPV:
533 ptr = SSPOPPTR;
534 Safefree((char*)ptr);
535 break;
536 case SAVEt_CLEARSV:
4aa0a1f7 537 ptr = (void*)&curpad[SSPOPLONG];
8990e307 538 sv = *(SV**)ptr;
a0d0e21e 539 if (SvREFCNT(sv) <= 1) { /* Can clear pad variable in place. */
8990e307
LW
540 if (SvTHINKFIRST(sv)) {
541 if (SvREADONLY(sv))
542 croak("panic: leave_scope clearsv");
543 if (SvROK(sv))
544 sv_unref(sv);
545 }
a0d0e21e
LW
546 if (SvMAGICAL(sv))
547 mg_free(sv);
8990e307
LW
548
549 switch (SvTYPE(sv)) {
550 case SVt_NULL:
551 break;
552 case SVt_PVAV:
553 av_clear((AV*)sv);
554 break;
555 case SVt_PVHV:
556 hv_clear((HV*)sv);
557 break;
558 case SVt_PVCV:
559 sub_generation++;
85e6fe83 560 cv_undef((CV*)sv);
8990e307
LW
561 break;
562 default:
563 if (SvPOK(sv) && SvLEN(sv))
a0d0e21e
LW
564 (void)SvOOK_off(sv);
565 (void)SvOK_off(sv);
8990e307
LW
566 break;
567 }
568 }
569 else { /* Someone has a claim on this, so abandon it. */
4aa0a1f7 570 U32 padflags = SvFLAGS(sv) & (SVs_PADBUSY|SVs_PADMY|SVs_PADTMP);
8990e307
LW
571 SvREFCNT_dec(sv); /* Cast current value to the winds. */
572 switch (SvTYPE(sv)) { /* Console ourselves with a new value */
573 case SVt_PVAV: *(SV**)ptr = (SV*)newAV(); break;
574 case SVt_PVHV: *(SV**)ptr = (SV*)newHV(); break;
575 default: *(SV**)ptr = NEWSV(0,0); break;
576 }
4aa0a1f7 577 SvFLAGS(*(SV**)ptr) |= padflags; /* preserve pad nature */
8990e307
LW
578 }
579 break;
580 case SAVEt_DELETE:
581 ptr = SSPOPPTR;
582 hv = (HV*)ptr;
583 ptr = SSPOPPTR;
748a9306 584 (void)hv_delete(hv, (char*)ptr, (U32)SSPOPINT, G_DISCARD);
adbc6bb1 585 Safefree(ptr);
8990e307 586 break;
a0d0e21e
LW
587 case SAVEt_DESTRUCTOR:
588 ptr = SSPOPPTR;
589 (*SSPOPDPTR)(ptr);
590 break;
591 case SAVEt_REGCONTEXT:
8e07c86e
AD
592 {
593 I32 delta = SSPOPINT;
594 savestack_ix -= delta; /* regexp must have croaked */
595 }
a0d0e21e 596 break;
55497cff
PP
597 case SAVEt_STACK_POS: /* Position on Perl stack */
598 {
599 I32 delta = SSPOPINT;
600 stack_sp = stack_base + delta;
601 }
602 break;
79072805 603 default:
463ee0b2 604 croak("panic: leave_scope inconsistency");
79072805
LW
605 }
606 }
607}
8990e307
LW
608
609#ifdef DEBUGGING
1f96a9ed 610
8990e307
LW
611void
612cx_dump(cx)
613CONTEXT* cx;
614{
760ac839 615 PerlIO_printf(Perl_debug_log, "CX %d = %s\n", cx - cxstack, block_type[cx->cx_type]);
8990e307 616 if (cx->cx_type != CXt_SUBST) {
760ac839
LW
617 PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp);
618 PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%lx\n", (long)cx->blk_oldcop);
619 PerlIO_printf(Perl_debug_log, "BLK_OLDMARKSP = %ld\n", (long)cx->blk_oldmarksp);
620 PerlIO_printf(Perl_debug_log, "BLK_OLDSCOPESP = %ld\n", (long)cx->blk_oldscopesp);
621 PerlIO_printf(Perl_debug_log, "BLK_OLDRETSP = %ld\n", (long)cx->blk_oldretsp);
622 PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%lx\n", (long)cx->blk_oldpm);
623 PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", cx->blk_gimme ? "LIST" : "SCALAR");
8990e307
LW
624 }
625 switch (cx->cx_type) {
626 case CXt_NULL:
627 case CXt_BLOCK:
628 break;
629 case CXt_SUB:
760ac839 630 PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%lx\n",
8990e307 631 (long)cx->blk_sub.cv);
760ac839 632 PerlIO_printf(Perl_debug_log, "BLK_SUB.GV = 0x%lx\n",
8990e307 633 (long)cx->blk_sub.gv);
760ac839 634 PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%lx\n",
8990e307 635 (long)cx->blk_sub.dfoutgv);
760ac839 636 PerlIO_printf(Perl_debug_log, "BLK_SUB.OLDDEPTH = %ld\n",
8990e307 637 (long)cx->blk_sub.olddepth);
760ac839 638 PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
8990e307
LW
639 (int)cx->blk_sub.hasargs);
640 break;
641 case CXt_EVAL:
760ac839 642 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_IN_EVAL = %ld\n",
8990e307 643 (long)cx->blk_eval.old_in_eval);
760ac839 644 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_OP_TYPE = %s (%s)\n",
c07a80fd
PP
645 op_name[cx->blk_eval.old_op_type],
646 op_desc[cx->blk_eval.old_op_type]);
760ac839 647 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_NAME = %s\n",
8990e307 648 cx->blk_eval.old_name);
760ac839 649 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_EVAL_ROOT = 0x%lx\n",
8990e307
LW
650 (long)cx->blk_eval.old_eval_root);
651 break;
652
653 case CXt_LOOP:
760ac839 654 PerlIO_printf(Perl_debug_log, "BLK_LOOP.LABEL = %s\n",
8990e307 655 cx->blk_loop.label);
760ac839 656 PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
8990e307 657 (long)cx->blk_loop.resetsp);
760ac839 658 PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%lx\n",
8990e307 659 (long)cx->blk_loop.redo_op);
760ac839 660 PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%lx\n",
8990e307 661 (long)cx->blk_loop.next_op);
760ac839 662 PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%lx\n",
8990e307 663 (long)cx->blk_loop.last_op);
760ac839 664 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERIX = %ld\n",
8990e307 665 (long)cx->blk_loop.iterix);
760ac839 666 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%lx\n",
8990e307 667 (long)cx->blk_loop.iterary);
760ac839 668 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERVAR = 0x%lx\n",
8990e307
LW
669 (long)cx->blk_loop.itervar);
670 if (cx->blk_loop.itervar)
760ac839 671 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERSAVE = 0x%lx\n",
8990e307 672 (long)cx->blk_loop.itersave);
7a4c00b4
PP
673 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERLVAL = 0x%lx\n",
674 (long)cx->blk_loop.iterlval);
8990e307
LW
675 break;
676
677 case CXt_SUBST:
760ac839 678 PerlIO_printf(Perl_debug_log, "SB_ITERS = %ld\n",
8990e307 679 (long)cx->sb_iters);
760ac839 680 PerlIO_printf(Perl_debug_log, "SB_MAXITERS = %ld\n",
8990e307 681 (long)cx->sb_maxiters);
760ac839 682 PerlIO_printf(Perl_debug_log, "SB_SAFEBASE = %ld\n",
8990e307 683 (long)cx->sb_safebase);
760ac839 684 PerlIO_printf(Perl_debug_log, "SB_ONCE = %ld\n",
8990e307 685 (long)cx->sb_once);
760ac839 686 PerlIO_printf(Perl_debug_log, "SB_ORIG = %s\n",
8990e307 687 cx->sb_orig);
760ac839 688 PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%lx\n",
8990e307 689 (long)cx->sb_dstr);
760ac839 690 PerlIO_printf(Perl_debug_log, "SB_TARG = 0x%lx\n",
8990e307 691 (long)cx->sb_targ);
760ac839 692 PerlIO_printf(Perl_debug_log, "SB_S = 0x%lx\n",
8990e307 693 (long)cx->sb_s);
760ac839 694 PerlIO_printf(Perl_debug_log, "SB_M = 0x%lx\n",
8990e307 695 (long)cx->sb_m);
760ac839 696 PerlIO_printf(Perl_debug_log, "SB_STREND = 0x%lx\n",
8990e307 697 (long)cx->sb_strend);
760ac839 698 PerlIO_printf(Perl_debug_log, "SB_SUBBASE = 0x%lx\n",
8990e307
LW
699 (long)cx->sb_subbase);
700 break;
701 }
702}
703#endif