1 /* $Header: cmd.c,v 4.0 91/03/20 01:04:18 lwall Locked $
3 * Copyright (c) 1989, Larry Wall
5 * You may distribute under the terms of the GNU General Public License
6 * as specified in the README file that comes with the perl 3.0 kit.
9 * Revision 4.0 91/03/20 01:04:18 lwall
25 /* do longjmps() clobber register variables? */
27 #if defined(cray) || defined(__STDC__)
31 /* This is the main command loop. We try to spend as much time in this loop
32 * as possible, so lots of optimizations do their activities in here. This
33 * means things get a little sloppy.
37 cmd_exec(cmdparm,gimme,sp)
38 CMD *VOLATILE cmdparm;
42 register CMD *cmd = cmdparm;
43 SPAT *VOLATILE oldspat;
44 VOLATILE int firstsave = savestack->ary_fill;
46 VOLATILE int aryoptsave;
48 VOLATILE int olddlevel;
49 VOLATILE int entdlevel;
51 register STR *retstr = &str_undef;
53 register int cmdflags;
55 register char *go_to = goto_targ;
56 register int newsp = -2;
57 register STR **st = stack->ary_array;
70 tainted = 0; /* Each statement is presumed innocent */
73 if (gimme == G_ARRAY && newsp > -2)
80 cmdflags = cmd->c_flags; /* hopefully load register */
82 if (cmd->c_label && strEQ(go_to,cmd->c_label))
83 goto_targ = go_to = Nullch; /* here at last */
85 switch (cmd->c_type) {
88 oldsave = savestack->ary_fill;
94 if (cmd->ucmd.ccmd.cc_true) {
97 debname[dlevel] = 't';
98 debdelim[dlevel] = '_';
99 if (++dlevel >= dlmax)
103 newsp = cmd_exec(cmd->ucmd.ccmd.cc_true,gimme && (cmdflags & CF_TERM),sp);
104 st = stack->ary_array; /* possibly reallocated */
110 if (savestack->ary_fill > oldsave)
111 restorelist(oldsave);
115 cmd = cmd->ucmd.ccmd.cc_alt;
116 goto tail_recursion_entry;
119 oldsave = savestack->ary_fill;
125 if (cmd->ucmd.ccmd.cc_true) {
128 debname[dlevel] = 'e';
129 debdelim[dlevel] = '_';
130 if (++dlevel >= dlmax)
134 newsp = cmd_exec(cmd->ucmd.ccmd.cc_true,gimme && (cmdflags & CF_TERM),sp);
135 st = stack->ary_array; /* possibly reallocated */
141 if (savestack->ary_fill > oldsave)
142 restorelist(oldsave);
149 if (!(cmdflags & CF_ONCE)) {
151 if (++loop_ptr >= loop_max) {
153 Renew(loop_stack, loop_max, struct loop);
155 loop_stack[loop_ptr].loop_label = cmd->c_label;
156 loop_stack[loop_ptr].loop_sp = sp;
159 deb("(Pushing label #%d %s)\n",
160 loop_ptr, cmd->c_label ? cmd->c_label : "");
167 match = setjmp(loop_stack[loop_ptr].loop_env);
169 st = stack->ary_array; /* possibly reallocated */
172 cmdflags = cmd->c_flags|CF_ONCE;
174 if (savestack->ary_fill > oldsave)
175 restorelist(oldsave);
178 fatal("longjmp returned bad value (%d)",match);
179 case O_LAST: /* not done unless go_to found */
186 newsp = sp + lastsize;
194 case O_NEXT: /* not done unless go_to found */
201 case O_REDO: /* not done unless go_to found */
211 oldsave = savestack->ary_fill;
215 if (cmd->ucmd.ccmd.cc_true) {
218 debname[dlevel] = 't';
219 debdelim[dlevel] = '_';
220 if (++dlevel >= dlmax)
224 newsp = cmd_exec(cmd->ucmd.ccmd.cc_true,gimme && (cmdflags & CF_TERM),sp);
225 st = stack->ary_array; /* possibly reallocated */
235 if (cmd->ucmd.ccmd.cc_alt) {
238 debname[dlevel] = 'a';
239 debdelim[dlevel] = '_';
240 if (++dlevel >= dlmax)
244 newsp = cmd_exec(cmd->ucmd.ccmd.cc_alt,gimme && (cmdflags & CF_TERM),sp);
245 st = stack->ary_array; /* possibly reallocated */
254 if (cmd && cmd->c_head == cmd)
255 /* reached end of while loop */
256 return sp; /* targ isn't in this block */
257 if (cmdflags & CF_ONCE) {
260 tmps = loop_stack[loop_ptr].loop_label;
261 deb("(Popping label #%d %s)\n",loop_ptr,
267 goto tail_recursion_entry;
273 /* Set line number so run-time errors can be located */
280 deb("%s (%lx) r%lx t%lx a%lx n%lx cs%lx\n",
281 cmdname[cmd->c_type],cmd,cmd->c_expr,
282 cmd->ucmd.ccmd.cc_true,cmd->ucmd.ccmd.cc_alt,cmd->c_next,
285 debname[dlevel] = cmdname[cmd->c_type][0];
286 debdelim[dlevel] = '!';
287 if (++dlevel >= dlmax)
292 /* Here is some common optimization */
294 if (cmdflags & CF_COND) {
295 switch (cmdflags & CF_OPTIMIZE) {
298 retstr = cmd->c_short;
301 if (cmdflags & CF_NESURE)
305 retstr = cmd->c_short;
308 if (cmdflags & CF_EQSURE)
313 retstr = STAB_STR(cmd->c_stab);
315 match = str_true(retstr); /* => retstr = retstr, c2 should fix */
316 if (cmdflags & (match ? CF_EQSURE : CF_NESURE))
320 case CFT_ANCHOR: /* /^pat/ optimization */
322 if (*cmd->c_short->str_ptr && !(cmdflags & CF_EQSURE))
323 goto scanner; /* just unanchor it */
325 break; /* must evaluate */
328 case CFT_STROP: /* string op optimization */
329 retstr = STAB_STR(cmd->c_stab);
332 if (*cmd->c_short->str_ptr == *str_get(retstr) &&
333 bcmp(cmd->c_short->str_ptr, str_get(retstr),
334 cmd->c_slen) == 0 ) {
335 if (cmdflags & CF_EQSURE) {
336 if (sawampersand && (cmdflags & CF_OPTIMIZE) != CFT_STROP) {
339 str_nset(stab_val(leftstab),"",0);
341 str_sset(stab_val(amperstab),cmd->c_short);
343 str_nset(stab_val(rightstab),
344 retstr->str_ptr + cmd->c_slen,
345 retstr->str_cur - cmd->c_slen);
348 lastspat = cmd->c_spat;
349 match = !(cmdflags & CF_FIRSTNEG);
354 else if (cmdflags & CF_NESURE) {
355 match = cmdflags & CF_FIRSTNEG;
361 char *zap1, *zap2, zap1c, zap2c;
364 zap1 = cmd->c_short->str_ptr;
365 zap2 = str_get(retstr);
368 zaplen = cmd->c_slen;
369 if ((zap1c == zap2c) && (bcmp(zap1, zap2, zaplen) == 0)) {
370 if (cmdflags & CF_EQSURE) {
372 (cmdflags & CF_OPTIMIZE) != CFT_STROP) {
375 str_nset(stab_val(leftstab),"",0);
377 str_sset(stab_val(amperstab),cmd->c_short);
379 str_nset(stab_val(rightstab),
380 retstr->str_ptr + cmd->c_slen,
381 retstr->str_cur - cmd->c_slen);
384 lastspat = cmd->c_spat;
385 match = !(cmdflags & CF_FIRSTNEG);
390 else if (cmdflags & CF_NESURE) {
391 match = cmdflags & CF_FIRSTNEG;
397 break; /* must evaluate */
399 case CFT_SCAN: /* non-anchored search */
401 retstr = STAB_STR(cmd->c_stab);
403 if (retstr->str_pok & SP_STUDIED)
404 if (screamfirst[cmd->c_short->str_rare] >= 0)
405 tmps = screaminstr(retstr, cmd->c_short);
409 tmps = str_get(retstr); /* make sure it's pok */
411 tmps = fbminstr((unsigned char*)tmps,
412 (unsigned char*)tmps + retstr->str_cur, cmd->c_short);
416 if (cmdflags & CF_EQSURE) {
417 ++cmd->c_short->str_u.str_useful;
421 str_nset(stab_val(leftstab),retstr->str_ptr,
422 tmps - retstr->str_ptr);
424 str_nset(stab_val(amperstab),
425 tmps, cmd->c_short->str_cur);
427 str_nset(stab_val(rightstab),
428 tmps + cmd->c_short->str_cur,
429 retstr->str_cur - (tmps - retstr->str_ptr) -
430 cmd->c_short->str_cur);
432 lastspat = cmd->c_spat;
433 match = !(cmdflags & CF_FIRSTNEG);
441 if (cmdflags & CF_NESURE) {
442 ++cmd->c_short->str_u.str_useful;
443 match = cmdflags & CF_FIRSTNEG;
448 if (--cmd->c_short->str_u.str_useful < 0) {
449 cmdflags &= ~CF_OPTIMIZE;
450 cmdflags |= CFT_EVAL; /* never try this optimization again */
451 cmd->c_flags = (cmdflags & ~CF_ONCE);
453 break; /* must evaluate */
455 case CFT_NUMOP: /* numeric op optimization */
456 retstr = STAB_STR(cmd->c_stab);
458 switch (cmd->c_slen) {
461 if ((!retstr->str_nok && !looks_like_number(retstr)))
462 warn("Possible use of == on string value");
464 match = (str_gnum(retstr) == cmd->c_short->str_u.str_nval);
467 match = (str_gnum(retstr) != cmd->c_short->str_u.str_nval);
470 match = (str_gnum(retstr) < cmd->c_short->str_u.str_nval);
473 match = (str_gnum(retstr) <= cmd->c_short->str_u.str_nval);
476 match = (str_gnum(retstr) > cmd->c_short->str_u.str_nval);
479 match = (str_gnum(retstr) >= cmd->c_short->str_u.str_nval);
483 if (cmdflags & CF_EQSURE) {
488 else if (cmdflags & CF_NESURE) {
492 break; /* must evaluate */
494 case CFT_INDGETS: /* while (<$foo>) */
495 last_in_stab = stabent(str_get(STAB_STR(cmd->c_stab)),TRUE);
496 if (!stab_io(last_in_stab))
497 stab_io(last_in_stab) = stio_new();
499 case CFT_GETS: /* really a while (<file>) */
500 last_in_stab = cmd->c_stab;
502 fp = stab_io(last_in_stab)->ifp;
503 retstr = stab_val(defstab);
506 if (fp && str_gets(retstr, fp, 0)) {
507 if (*retstr->str_ptr == '0' && retstr->str_cur == 1)
511 stab_io(last_in_stab)->lines++;
513 else if (stab_io(last_in_stab)->flags & IOF_ARGV) {
515 goto doeval; /* first time through */
516 fp = nextargv(last_in_stab);
519 (void)do_close(last_in_stab,FALSE);
520 stab_io(last_in_stab)->flags |= IOF_START;
532 while (tmps_max > tmps_base) { /* clean up after last eval */
533 str_free(tmps_list[tmps_max]);
534 tmps_list[tmps_max--] = Nullstr;
536 newsp = eval(cmd->c_expr,gimme && (cmdflags & CF_TERM),sp);
537 st = stack->ary_array; /* possibly reallocated */
539 match = str_true(retstr);
540 if (cmd->c_expr->arg_type == O_FLIP) /* undid itself? */
541 cmdflags = copyopt(cmd,cmd->c_expr[3].arg_ptr.arg_cmd);
544 retstr = stab_val(cmd->c_stab);
546 match = (retstr->str_cur != 0);
547 tmps = str_get(retstr);
548 tmps += retstr->str_cur - match;
549 str_nset(&str_chop,tmps,match);
552 retstr->str_cur = tmps - retstr->str_ptr;
557 match = cmd->c_short->str_u.str_useful; /* just to get register */
559 if (match < 0) { /* first time through here? */
560 ar = stab_array(cmd->c_expr[1].arg_ptr.arg_stab);
561 aryoptsave = savestack->ary_fill;
562 savesptr(&stab_val(cmd->c_stab));
563 savelong(&cmd->c_short->str_u.str_useful);
566 ar = stab_xarray(cmd->c_expr[1].arg_ptr.arg_stab);
567 if (cmd->c_type != C_WHILE && savestack->ary_fill > firstsave)
568 restorelist(firstsave);
571 if (match >= ar->ary_fill) { /* we're in LAST, probably */
573 cmd->c_short->str_u.str_useful = -1; /* actually redundant */
578 if (!(retstr = ar->ary_array[match]))
579 retstr = afetch(ar,match,TRUE);
580 stab_val(cmd->c_stab) = retstr;
581 cmd->c_short->str_u.str_useful = match;
589 if (DBsingle->str_u.str_nval != 0)
591 if (DBsignal->str_u.str_nval != 0)
593 if (DBtrace->str_u.str_nval != 0)
598 /* we have tried to make this normal case as abnormal as possible */
601 if (gimme == G_ARRAY) {
602 lastretstr = Nullstr;
604 lastsize = newsp - sp;
610 while (tmps_max > tmps_base) { /* clean up after last eval */
611 str_free(tmps_list[tmps_max]);
612 tmps_list[tmps_max--] = Nullstr;
614 newsp = eval(cmd->c_expr,
615 gimme && (cmdflags & CF_TERM) && cmd->c_type == C_EXPR &&
616 !cmd->ucmd.acmd.ac_expr,
618 st = stack->ary_array; /* possibly reallocated */
620 if (newsp > sp && retstr)
621 match = str_true(retstr);
626 /* if flipflop was true, flop it */
629 if (match && cmdflags & CF_FLIP) {
630 while (tmps_max > tmps_base) { /* clean up after last eval */
631 str_free(tmps_list[tmps_max]);
632 tmps_list[tmps_max--] = Nullstr;
634 if (cmd->c_expr->arg_type == O_FLOP) { /* currently toggled? */
635 newsp = eval(cmd->c_expr,G_SCALAR,sp);/*let eval undo it*/
636 cmdflags = copyopt(cmd,cmd->c_expr[3].arg_ptr.arg_cmd);
639 newsp = eval(cmd->c_expr,G_SCALAR,sp);/* let eval do it */
640 if (cmd->c_expr->arg_type == O_FLOP) /* still toggled? */
641 cmdflags = copyopt(cmd,cmd->c_expr[4].arg_ptr.arg_cmd);
644 else if (cmdflags & CF_FLIP) {
645 if (cmd->c_expr->arg_type == O_FLOP) { /* currently toggled? */
646 match = TRUE; /* force on */
650 /* at this point, match says whether our expression was true */
653 if (cmdflags & CF_INVERT)
659 tainted = 0; /* modifier doesn't affect regular expression */
662 /* now to do the actual command, if any */
664 switch (cmd->c_type) {
666 fatal("panic: cmd_exec");
667 case C_EXPR: /* evaluated for side effects */
668 if (cmd->ucmd.acmd.ac_expr) { /* more to do? */
669 if (gimme == G_ARRAY) {
670 lastretstr = Nullstr;
672 lastsize = newsp - sp;
678 while (tmps_max > tmps_base) { /* clean up after last eval */
679 str_free(tmps_list[tmps_max]);
680 tmps_list[tmps_max--] = Nullstr;
682 newsp = eval(cmd->ucmd.acmd.ac_expr,gimme && (cmdflags&CF_TERM),sp);
683 st = stack->ary_array; /* possibly reallocated */
689 double value = str_gnum(STAB_STR(cmd->c_stab));
693 if (((double)match) > value)
694 --match; /* was fractional--truncate other way */
699 match = *(str_get(STAB_STR(cmd->c_stab))) & 255;
701 match -= cmd->ucmd.scmd.sc_offset;
704 else if (match > cmd->ucmd.scmd.sc_max)
705 match = cmd->ucmd.scmd.sc_max;
706 cmd = cmd->ucmd.scmd.sc_next[match];
707 goto tail_recursion_entry;
709 cmd = cmd->ucmd.ccmd.cc_alt;
710 goto tail_recursion_entry;
712 fatal("panic: ELSIF");
715 oldsave = savestack->ary_fill;
721 if (cmd->ucmd.ccmd.cc_true) {
724 debname[dlevel] = 't';
725 debdelim[dlevel] = '_';
726 if (++dlevel >= dlmax)
730 newsp = cmd_exec(cmd->ucmd.ccmd.cc_true,gimme && (cmdflags & CF_TERM),sp);
731 st = stack->ary_array; /* possibly reallocated */
735 if (savestack->ary_fill > oldsave)
736 restorelist(oldsave);
740 cmd = cmd->ucmd.ccmd.cc_alt;
741 goto tail_recursion_entry;
744 oldsave = savestack->ary_fill;
750 if (cmd->ucmd.ccmd.cc_true) {
753 debname[dlevel] = 'e';
754 debdelim[dlevel] = '_';
755 if (++dlevel >= dlmax)
759 newsp = cmd_exec(cmd->ucmd.ccmd.cc_true,gimme && (cmdflags & CF_TERM),sp);
760 st = stack->ary_array; /* possibly reallocated */
764 if (savestack->ary_fill > oldsave)
765 restorelist(oldsave);
772 if (!(cmdflags & CF_ONCE)) { /* first time through here? */
774 if (++loop_ptr >= loop_max) {
776 Renew(loop_stack, loop_max, struct loop);
778 loop_stack[loop_ptr].loop_label = cmd->c_label;
779 loop_stack[loop_ptr].loop_sp = sp;
782 deb("(Pushing label #%d %s)\n",
783 loop_ptr, cmd->c_label ? cmd->c_label : "");
790 match = setjmp(loop_stack[loop_ptr].loop_env);
792 st = stack->ary_array; /* possibly reallocated */
795 cmdflags = cmd->c_flags|CF_ONCE;
798 if (savestack->ary_fill > oldsave)
799 restorelist(oldsave);
802 fatal("longjmp returned bad value (%d)",match);
809 newsp = sp + lastsize;
832 oldsave = savestack->ary_fill;
837 if (cmd->ucmd.ccmd.cc_true) {
840 debname[dlevel] = 't';
841 debdelim[dlevel] = '_';
842 if (++dlevel >= dlmax)
846 newsp = cmd_exec(cmd->ucmd.ccmd.cc_true,gimme && (cmdflags & CF_TERM),sp);
847 st = stack->ary_array; /* possibly reallocated */
850 /* actually, this spot is rarely reached anymore since the above
851 * cmd_exec() returns through longjmp(). Hooray for structure.
857 if (cmd->ucmd.ccmd.cc_alt) {
860 debname[dlevel] = 'a';
861 debdelim[dlevel] = '_';
862 if (++dlevel >= dlmax)
866 newsp = cmd_exec(cmd->ucmd.ccmd.cc_alt,gimme && (cmdflags & CF_TERM),sp);
867 st = stack->ary_array; /* possibly reallocated */
872 if (savestack->ary_fill > oldsave) {
873 if (cmdflags & CF_TERM) {
874 for (match = sp + 1; match <= newsp; match++)
875 st[match] = str_mortal(st[match]);
878 restorelist(oldsave);
881 dlevel = olddlevel - 1;
883 if (cmd->c_type != C_BLOCK)
884 goto until_loop; /* go back and evaluate conditional again */
886 if (cmdflags & CF_LOOP) {
887 cmdflags |= CF_COND; /* now test the condition */
894 if (cmdflags & CF_ONCE) {
897 tmps = loop_stack[loop_ptr].loop_label;
898 deb("(Popping label #%d %s)\n",loop_ptr, tmps ? tmps : "");
902 if ((cmdflags & CF_OPTIMIZE) == CFT_ARRAY &&
903 savestack->ary_fill > aryoptsave)
904 restorelist(aryoptsave);
907 goto tail_recursion_entry;
913 deb(pat,a1,a2,a3,a4,a5,a6,a7,a8)
918 fprintf(stderr,"%-4ld",(long)curcmd->c_line);
919 for (i=0; i<dlevel; i++)
920 fprintf(stderr,"%c%c ",debname[i],debdelim[i]);
921 fprintf(stderr,pat,a1,a2,a3,a4,a5,a6,a7,a8);
933 fprintf(stderr,"%-4ld",(long)curcmd->c_line);
934 for (i=0; i<dlevel; i++)
935 fprintf(stderr,"%c%c ",debname[i],debdelim[i]);
937 pat = va_arg(args, char *);
938 (void) vfprintf(stderr,pat,args);
948 cmd->c_flags &= CF_ONCE|CF_COND|CF_LOOP;
949 cmd->c_flags |= which->c_flags;
950 cmd->c_short = which->c_short;
951 cmd->c_slen = which->c_slen;
952 cmd->c_stab = which->c_stab;
963 str->str_state = SS_SARY;
964 str->str_u.str_stab = stab;
966 Safefree(str->str_ptr);
967 str->str_ptr = Nullch;
970 str->str_ptr = (char*)stab_array(stab);
971 (void)apush(savestack,str); /* save array ptr */
972 stab_xarray(stab) = Null(ARRAY*);
973 return stab_xarray(aadd(stab));
983 str->str_state = SS_SHASH;
984 str->str_u.str_stab = stab;
986 Safefree(str->str_ptr);
987 str->str_ptr = Nullch;
990 str->str_ptr = (char*)stab_hash(stab);
991 (void)apush(savestack,str); /* save hash ptr */
992 stab_xhash(stab) = Null(HASH*);
993 return stab_xhash(hadd(stab));
1002 (void)apush(savestack,item); /* remember the pointer */
1003 str = Str_new(12,0);
1005 (void)apush(savestack,str); /* remember the value */
1014 str = Str_new(13,0);
1015 str->str_state = SS_SINT;
1016 str->str_u.str_useful = (long)*intp; /* remember value */
1018 Safefree(str->str_ptr);
1021 str->str_ptr = (char*)intp; /* remember pointer */
1022 (void)apush(savestack,str);
1031 str = Str_new(14,0);
1032 str->str_state = SS_SLONG;
1033 str->str_u.str_useful = *longp; /* remember value */
1035 Safefree(str->str_ptr);
1038 str->str_ptr = (char*)longp; /* remember pointer */
1039 (void)apush(savestack,str);
1048 str = Str_new(15,0);
1049 str->str_state = SS_SSTRP;
1050 str->str_magic = *sptr; /* remember value */
1052 Safefree(str->str_ptr);
1055 str->str_ptr = (char*)sptr; /* remember pointer */
1056 (void)apush(savestack,str);
1065 str = Str_new(16,0);
1066 str->str_state = SS_SNSTAB;
1067 str->str_magic = (STR*)stab; /* remember which stab to free */
1068 (void)apush(savestack,str);
1077 str = Str_new(17,0);
1078 str->str_state = SS_SHPTR;
1079 str->str_u.str_hash = *hptr; /* remember value */
1081 Safefree(str->str_ptr);
1084 str->str_ptr = (char*)hptr; /* remember pointer */
1085 (void)apush(savestack,str);
1089 savelist(sarg,maxsarg)
1090 register STR **sarg;
1096 for (i = 1; i <= maxsarg; i++) {
1097 (void)apush(savestack,sarg[i]); /* remember the pointer */
1098 str = Str_new(18,0);
1099 str_sset(str,sarg[i]);
1100 (void)apush(savestack,str); /* remember the value */
1101 sarg[i]->str_u.str_useful = -1;
1110 register STR *value;
1111 register STAB *stab;
1114 fatal("panic: corrupt saved stack index");
1115 while (savestack->ary_fill > base) {
1116 value = apop(savestack);
1117 switch (value->str_state) {
1118 case SS_NORM: /* normal string */
1120 str = apop(savestack);
1121 str_replace(str,value);
1124 case SS_SARY: /* array reference */
1125 stab = value->str_u.str_stab;
1126 afree(stab_xarray(stab));
1127 stab_xarray(stab) = (ARRAY*)value->str_ptr;
1128 value->str_ptr = Nullch;
1131 case SS_SHASH: /* hash reference */
1132 stab = value->str_u.str_stab;
1133 (void)hfree(stab_xhash(stab), FALSE);
1134 stab_xhash(stab) = (HASH*)value->str_ptr;
1135 value->str_ptr = Nullch;
1138 case SS_SINT: /* int reference */
1139 *((int*)value->str_ptr) = (int)value->str_u.str_useful;
1140 value->str_ptr = Nullch;
1143 case SS_SLONG: /* long reference */
1144 *((long*)value->str_ptr) = value->str_u.str_useful;
1145 value->str_ptr = Nullch;
1148 case SS_SSTRP: /* STR* reference */
1149 *((STR**)value->str_ptr) = value->str_magic;
1150 value->str_magic = Nullstr;
1151 value->str_ptr = Nullch;
1154 case SS_SHPTR: /* HASH* reference */
1155 *((HASH**)value->str_ptr) = value->str_u.str_hash;
1156 value->str_ptr = Nullch;
1160 stab = (STAB*)value->str_magic;
1161 value->str_magic = Nullstr;
1162 (void)stab_clear(stab);
1165 case SS_SCSV: /* callsave structure */
1167 CSV *csv = (CSV*) value->str_ptr;
1169 curcmd = csv->curcmd;
1170 curcsv = csv->curcsv;
1171 csv->sub->depth = csv->depth;
1172 if (csv->hasargs) { /* put back old @_ */
1173 afree(csv->argarray);
1174 stab_xarray(defstab) = csv->savearray;
1180 fatal("panic: restorelist inconsistency");
1190 Renew(debname, dlmax, char);
1191 Renew(debdelim, dlmax, char);