5 #define HunkAlloc BADGDFG sdfhhsf FHS
8 #define Host_Error Sys_Error
11 //=============================================================================
19 void PR_PrintStatement (progfuncs_t *progfuncs, dstatement16_t *s)
22 printf("PR_PrintStatement is unsupported\n");
24 if ( (unsigned)s->op < OP_NUMOPS)
26 printf ("%s ", pr_opcodes[s->op].name);
27 i = strlen(pr_opcodes[s->op].name);
32 if (s->op == OP_IF || s->op == OP_IFNOT)
33 printf ("%sbranch %i",PR_GlobalString(progfuncs, s->a),s->b);
34 else if (s->op == OP_GOTO)
36 printf ("branch %i",s->a);
38 else if ( (unsigned)(s->op - OP_STORE_F) < 6)
40 printf ("%s",PR_GlobalString(progfuncs, s->a));
41 printf ("%s", PR_GlobalStringNoContents(progfuncs, s->b));
46 printf ("%s",PR_GlobalString(progfuncs, s->a));
48 printf ("%s",PR_GlobalString(progfuncs, s->b));
50 printf ("%s", PR_GlobalStringNoContents(progfuncs, s->c));
61 char *QC_ucase(char *str)
69 if (*str >= 'a' && *str <= 'z')
70 *str = *str - 'a' + 'A';
76 void PR_StackTrace (progfuncs_t *progfuncs)
90 printf ("<NO STACK>\n");
95 globalbase = (int *)pr_globals + pr_xfunction->parm_start - pr_xfunction->locals;
98 pr_stack[pr_depth].f = pr_xfunction;
99 pr_stack[pr_depth].s = pr_xstatement;
100 for (i=pr_depth ; i>0 ; i--)
106 printf ("<NO FUNCTION>\n");
110 if (pr_stack[i].progsnum != progs)
112 progs = pr_stack[i].progsnum;
114 printf ("<%s>\n", pr_progstate[progs].filename);
117 printf ("stripped : %s\n", f->s_name+progfuncs->stringtable);
120 if (pr_progstate[progs].linenums)
121 printf ("%12s %i : %s\n", f->s_file+progfuncs->stringtable, pr_progstate[progs].linenums[pr_stack[i].s], f->s_name+progfuncs->stringtable);
123 printf ("%12s : %s\n", f->s_file+progfuncs->stringtable, f->s_name+progfuncs->stringtable);
128 for (arg = 0; arg < f->locals; arg++)
131 local = ED_GlobalAtOfs16(progfuncs, f->parm_start+arg);
134 printf(" ofs %i: %f : %i\n", f->parm_start+arg, *(float *)(globalbase - f->locals+arg), *(int *)(globalbase - f->locals+arg) );
138 printf(" %s: %s\n", local->s_name+progfuncs->stringtable, PR_ValueString(progfuncs, local->type, (eval_t*)(globalbase - f->locals+arg)));
139 if (local->type == ev_vector)
145 globalbase = localstack + localstack_used;
147 globalbase -= f->locals;
160 void PR_Profile_f (void)
162 dfunction_t *f, *best;
172 for (i=0 ; i<pr_progs->numfunctions ; i++)
174 f = &pr_functions[i];
175 if (f->profile > max && f->first_statement >=0)
184 printf ("%7i %s\n", best->profile, best->s_name);
197 Aborts the currently executing function
200 void VARGS PR_RunError (progfuncs_t *progfuncs, char *error, ...)
205 va_start (argptr,error);
206 Q_vsnprintf (string,sizeof(string)-1, error,argptr);
210 // void SV_EndRedirect (void);
214 // PR_PrintStatement (pr_statements + pr_xstatement);
215 PR_StackTrace (progfuncs);
218 //editbadfile(pr_strings + pr_xfunction->s_file, -1);
220 // pr_depth = 0; // dump the stack so host_error can shutdown functions
221 // prinst->exitdepth = 0;
223 Abort ("%s", string);
227 ============================================================================
230 The interpretation main loop
231 ============================================================================
238 Returns the new program statement counter
241 void PR_AbortStack (progfuncs_t *progfuncs);
242 int PR_EnterFunction (progfuncs_t *progfuncs, dfunction_t *f, int progsnum)
246 pr_stack[pr_depth].s = pr_xstatement;
247 pr_stack[pr_depth].f = pr_xfunction;
248 pr_stack[pr_depth].progsnum = progsnum;
249 pr_stack[pr_depth].pushed = pr_spushed;
251 if (pr_depth == MAX_STACK_DEPTH)
254 PR_StackTrace (progfuncs);
256 printf ("stack overflow on call to %s\n", progfuncs->stringtable+f->s_name);
258 //comment this out if you want the progs to try to continue anyway (could cause infinate loops)
259 PR_AbortStack(progfuncs);
260 Abort("Stack Overflow in %s\n", progfuncs->stringtable+f->s_name);
261 return pr_xstatement;
264 localstack_used += pr_spushed; //make sure the call doesn't hurt pushed pointers
266 // save off any locals that the new function steps on (to a side place, fromwhere they are restored on exit)
268 if (localstack_used + c > LOCALSTACK_SIZE)
270 localstack_used -= pr_spushed;
272 PR_RunError (progfuncs, "PR_ExecuteProgram: locals stack overflow\n");
275 for (i=0 ; i < c ; i++)
276 localstack[localstack_used+i] = ((int *)pr_globals)[f->parm_start + i];
277 localstack_used += c;
279 // copy parameters (set initial values)
281 for (i=0 ; i<f->numparms ; i++)
283 for (j=0 ; j<f->parm_size[i] ; j++)
285 ((int *)pr_globals)[o] = ((int *)pr_globals)[OFS_PARM0+i*3+j];
291 return f->first_statement - 1; // offset the s++
299 int PR_LeaveFunction (progfuncs_t *progfuncs)
304 Sys_Error ("prog stack underflow");
306 // restore locals from the stack
307 c = pr_xfunction->locals;
308 localstack_used -= c;
309 if (localstack_used < 0)
310 PR_RunError (progfuncs, "PR_ExecuteProgram: locals stack underflow\n");
312 for (i=0 ; i < c ; i++)
313 ((int *)pr_globals)[pr_xfunction->parm_start + i] = localstack[localstack_used+i];
317 PR_MoveParms(progfuncs, pr_stack[pr_depth].progsnum, pr_typecurrent);
318 PR_SwitchProgs(progfuncs, pr_stack[pr_depth].progsnum);
319 pr_xfunction = pr_stack[pr_depth].f;
320 pr_spushed = pr_stack[pr_depth].pushed;
322 localstack_used -= pr_spushed;
323 return pr_stack[pr_depth].s;
326 ddef32_t *ED_FindLocalOrGlobal(progfuncs_t *progfuncs, char *name, eval_t **val)
333 switch (pr_progstate[pr_typecurrent].intsize)
337 //this gets parms fine, but not locals
339 for (i = 0; i < pr_xfunction->numparms; i++)
341 def16 = ED_GlobalAtOfs16(progfuncs, pr_xfunction->parm_start+i);
344 if (!strcmp(def16->s_name+progfuncs->stringtable, name))
346 *val = (eval_t *)&pr_progstate[pr_typecurrent].globals[pr_xfunction->parm_start+i];
348 //we need something like this for functions that are not the top layer
349 // *val = (eval_t *)&localstack[localstack_used-pr_xfunction->numparms*4];
350 def.ofs = def16->ofs;
351 def.s_name = def16->s_name;
352 def.type = def16->type;
356 def16 = ED_FindGlobal16(progfuncs, name);
359 def.ofs = def16->ofs;
360 def.type = def16->type;
361 def.s_name = def16->s_name;
365 //this gets parms fine, but not locals
367 for (i = 0; i < pr_xfunction->numparms; i++)
369 def32 = ED_GlobalAtOfs32(progfuncs, pr_xfunction->parm_start+i);
372 if (!strcmp(def32->s_name+progfuncs->stringtable, name))
374 *val = (eval_t *)&pr_progstate[pr_typecurrent].globals[pr_xfunction->parm_start+i];
376 //we need something like this for functions that are not the top layer
377 // *val = (eval_t *)&localstack[localstack_used-pr_xfunction->numparms*4];
381 def32 = ED_FindGlobal32(progfuncs, name);
386 Sys_Error("Bad int size in ED_FindLocalOrGlobal");
390 *val = (eval_t *)&pr_progstate[pr_typecurrent].globals[def32->ofs];
394 char *COM_TrimString(char *str)
397 static char buffer[256];
398 while (*str <= ' ' && *str>'\0')
401 for (i = 0; i < 255; i++)
411 char *EvaluateDebugString(progfuncs_t *progfuncs, char *key)
413 static char buf[256];
423 assignment = strchr(key, '=');
427 c = strchr(key, '.');
429 def = ED_FindLocalOrGlobal(progfuncs, key, &val);
436 def->type = ev_entity;
438 val->edict = atoi(key);
444 return "(Bad string)";
448 //go through ent vars
449 c = strchr(key, '.');
454 type = type &~DEF_SAVEGLOBAL;
455 if (current_progstate->types)
456 type = current_progstate->types[type].type;
457 if (type != ev_entity)
458 return "'.' without entity";
460 fdef = ED_FindField(progfuncs, COM_TrimString(c2));
463 return "(Bad string)";
464 val = (eval_t *) (((char *)PROG_TO_EDICT(progfuncs, val->_int)->fields) + fdef->ofs*4);
471 switch (type&~DEF_SAVEGLOBAL)
474 *(string_t *)val = PR_StringToProgs(progfuncs, ED_NewString (progfuncs, assignment, 0));
478 *(float *)val = (float)atof (assignment);
482 *(int *)val = atoi (assignment);
486 strcpy (string, assignment);
489 for (i=0 ; i<3 ; i++)
491 while (*v && *v != ' ')
494 ((float *)d)[i] = (float)atof (w);
500 *(int *)val = EDICT_TO_PROG(progfuncs, EDICT_NUM(progfuncs, atoi (assignment)));
504 fdef = ED_FindField (progfuncs, assignment);
507 int l,nl = strlen(assignment);
508 strcpy(buf, "Can't find field ");
510 if (nl > sizeof(buf)-l-2)
511 nl = sizeof(buf)-l-2;
512 memcpy(buf+l, assignment, nl);
513 assignment[l+nl+0] = '\n';
514 assignment[l+nl+1] = 0;
517 *(int *)val = G_INT(fdef->ofs);
525 char *s = assignment;
526 if (s[0] && s[1] == ':')
531 else if (s[0] && s[1] && s[2] == ':')
537 func = ED_FindFunction (progfuncs, s, &i, progsnum);
540 int l,nl = strlen(s);
542 assignment[-1] = '=';
544 strcpy(buf, "Can't find field ");
546 if (nl > sizeof(buf)-l-2)
547 nl = sizeof(buf)-l-2;
548 memcpy(buf+l, assignment, nl);
549 assignment[l+nl+0] = '\n';
550 assignment[l+nl+1] = 0;
553 *(func_t *)val = (func - pr_progstate[i].functions) | (i<<24);
561 assignment[-1] = '=';
563 strcpy(buf, PR_ValueString(progfuncs, type, val));
569 //int EditorHighlightLine(window_t *wnd, int line);
570 void SetExecutionToLine(progfuncs_t *progfuncs, int linenum)
572 int pn = pr_typecurrent;
574 dfunction_t *f = pr_xfunction;
576 switch(current_progstate->intsize)
579 for (snum = f->first_statement; pr_progstate[pn].linenums[snum] < linenum; snum++)
581 if (pr_statements16[snum].op == OP_DONE)
587 for (snum = f->first_statement; pr_progstate[pn].linenums[snum] < linenum; snum++)
589 if (pr_statements32[snum].op == OP_DONE)
594 Sys_Error("Bad intsize");
597 debugstatement = snum;
598 // EditorHighlightLine(editwnd, pr_progstate[pn].linenums[snum]);
601 //0 clear. 1 set, 2 toggle, 3 check
602 int PR_ToggleBreakpoint(progfuncs_t *progfuncs, char *filename, int linenum, int flag) //write alternate route to work by function name.
607 int pn = pr_typecurrent;
611 for (pn = 0; (unsigned)pn < maxprogs; pn++)
613 if (!pr_progstate || !pr_progstate[pn].progs)
616 if (linenum) //linenum is set means to set the breakpoint on a file and line
618 if (!pr_progstate[pn].linenums)
621 for (f = pr_progstate[pn].functions, fl = 0; fl < pr_progstate[pn].progs->numfunctions; f++, fl++)
623 if (!stricmp(f->s_file+progfuncs->stringtable, filename))
625 for (i = f->first_statement; ; i++)
627 if (pr_progstate[pn].linenums[i] >= linenum)
629 fl = pr_progstate[pn].linenums[i];
632 if ((unsigned int)pr_progstate[pn].linenums[i] > fl)
635 switch(pr_progstate[pn].intsize)
638 op = ((dstatement16_t*)pr_progstate[pn].statements + i)->op;
642 op = ((dstatement32_t*)pr_progstate[pn].statements + i)->op;
645 Sys_Error("Bad intsize");
676 switch(pr_progstate[pn].intsize)
679 ((dstatement16_t*)pr_progstate[pn].statements + i)->op = op;
683 ((dstatement32_t*)pr_progstate[pn].statements + i)->op = op;
686 Sys_Error("Bad intsize");
696 else //set the breakpoint on the first statement of the function specified.
698 for (f = pr_progstate[pn].functions, fl = 0; fl < pr_progstate[pn].progs->numfunctions; f++, fl++)
700 if (!strcmp(f->s_name+progfuncs->stringtable, filename))
702 i = f->first_statement;
703 switch(pr_progstate[pn].intsize)
706 op = ((dstatement16_t*)pr_progstate[pn].statements + i)->op;
710 op = ((dstatement32_t*)pr_progstate[pn].statements + i)->op;
713 Sys_Error("Bad intsize");
743 switch(pr_progstate[pn].intsize)
746 ((dstatement16_t*)pr_progstate[pn].statements + i)->op = op;
750 ((dstatement32_t*)pr_progstate[pn].statements + i)->op = op;
753 Sys_Error("Bad intsize");
766 int ShowStep(progfuncs_t *progfuncs, int statement)
769 // texture realcursortex;
770 static int lastline = 0;
771 static char *lastfile = 0;
773 int pn = pr_typecurrent;
775 dfunction_t *f = pr_xfunction;
777 if (f && pr_progstate[pn].linenums && externs->useeditor)
779 if (lastline == pr_progstate[pn].linenums[statement] && lastfile == f->s_file+progfuncs->stringtable)
780 return statement; //no info/same line as last time
782 lastline = pr_progstate[pn].linenums[statement];
783 lastfile = f->s_file+progfuncs->stringtable;
785 lastline = externs->useeditor(progfuncs, lastfile, lastline, 0, NULL);
787 if (pr_progstate[pn].linenums[statement] != lastline)
789 for (i = f->first_statement; ; i++)
791 if (lastline == pr_progstate[pn].linenums[i])
795 else if (lastline <= pr_progstate[pn].linenums[i])
802 else if (f) //annoying.
804 if (*(f->s_file+progfuncs->stringtable)) //if we can't get the filename, then it was stripped, and debugging it like this is useless
805 if (externs->useeditor)
806 externs->useeditor(progfuncs, f->s_file+progfuncs->stringtable, -1, 0, NULL);
814 //DMW: all pointer functions are modified to be absoloute pointers from NULL not sv_edicts
820 void PR_ExecuteCode (progfuncs_t *progfuncs, int s)
822 eval_t *t, *swtch=NULL;
825 dstatement16_t *st16;
826 dstatement32_t *st32;
838 prinst->continuestatement = -1;
842 PR_EnterJIT(progfuncs, s);
846 fnum = pr_xfunction - pr_functions;
850 #define PRBOUNDSCHECK
851 #define RUNAWAYCHECK() \
854 pr_xstatement = st-pr_statements; \
855 PR_StackTrace(progfuncs); \
856 printf ("runaway loop error"); \
857 while(pr_depth > prinst->exitdepth) \
858 PR_LeaveFunction(progfuncs); \
863 #define OPA ((eval_t *)&glob[st->a])
864 #define OPB ((eval_t *)&glob[st->b])
865 #define OPC ((eval_t *)&glob[st->c])
867 restart: //jumped to when the progs might have changed.
869 switch (current_progstate->intsize)
873 st16 = &pr_statements16[s];
877 #ifdef SEPARATEINCLUDES
878 #include "execloop16d.h"
880 #include "execloop.h"
887 #include "execloop.h"
890 Sys_Error("PR_ExecuteProgram - should be unreachable");
895 st32 = &pr_statements32[s];
899 #ifdef SEPARATEINCLUDES
900 #include "execloop32d.h"
902 #include "execloop.h"
909 #ifdef SEPARATEINCLUDES
910 #include "execloop32.h"
912 #include "execloop.h"
916 Sys_Error("PR_ExecuteProgram - should be unreachable");
919 Sys_Error("PR_ExecuteProgram - bad intsize");
924 void PR_ExecuteProgram (progfuncs_t *progfuncs, func_t fnum)
928 unsigned int initial_progs;
935 unsigned int newprogs = (fnum & 0xff000000)>>24;
937 initial_progs = pr_typecurrent;
938 if (newprogs != initial_progs)
940 if (newprogs >= maxprogs || !&pr_progstate[newprogs].globals) //can happen with hexen2...
942 printf("PR_ExecuteProgram: tried branching into invalid progs\n");
945 PR_MoveParms(progfuncs, newprogs, pr_typecurrent);
946 PR_SwitchProgs(progfuncs, newprogs);
949 if (!(fnum & ~0xff000000) || (signed)(fnum & ~0xff000000) >= pr_progs->numfunctions)
951 // if (pr_global_struct->self)
952 // ED_Print (PROG_TO_EDICT(pr_global_struct->self));
953 printf("PR_ExecuteProgram: NULL function from exe\n");
954 // Host_Error ("PR_ExecuteProgram: NULL function from exe");
956 // PR_MoveParms(0, pr_typecurrent);
957 PR_SwitchProgs(progfuncs, initial_progs);
961 oldexitdepth = prinst->exitdepth;
963 f = &pr_functions[fnum & ~0xff000000];
965 if (f->first_statement < 0)
966 { // negative statements are built in functions
967 i = -f->first_statement;
969 if (i < externs->numglobalbuiltins)
970 (*externs->globalbuiltins[i]) (progfuncs, (struct globalvars_s *)current_progstate->globals);
973 i -= externs->numglobalbuiltins;
974 if (i > current_progstate->numbuiltins)
976 printf ("Bad builtin call number %i (from exe)\n", -f->first_statement);
977 // PR_MoveParms(p, pr_typecurrent);
978 PR_SwitchProgs(progfuncs, initial_progs);
981 current_progstate->builtins [i] (progfuncs, (struct globalvars_s *)current_progstate->globals);
983 PR_MoveParms(progfuncs, initial_progs, pr_typecurrent);
984 PR_SwitchProgs(progfuncs, initial_progs);
991 // make a stack frame
992 prinst->exitdepth = pr_depth;
995 s = PR_EnterFunction (progfuncs, f, initial_progs);
997 tempdepth = prinst->numtempstringsstack;
998 PR_ExecuteCode(progfuncs, s);
1001 PR_MoveParms(progfuncs, initial_progs, pr_typecurrent);
1002 PR_SwitchProgs(progfuncs, initial_progs);
1004 PR_FreeTemps(progfuncs, tempdepth);
1005 prinst->numtempstringsstack = tempdepth;
1007 prinst->exitdepth = oldexitdepth;
1020 typedef struct qcthread_s {
1022 qcthreadstack_t fstack[MAX_STACK_DEPTH];
1024 int lstack[LOCALSTACK_SIZE];
1030 struct qcthread_s *PR_ForkStack(progfuncs_t *progfuncs)
1031 { //QC code can call builtins that call qc code.
1032 //to get around the problems of restoring the builtins we simply don't save the thread over the builtin.
1034 int ed = prinst->exitdepth;
1035 int localsoffset, baselocalsoffset;
1036 qcthread_t *thread = memalloc(sizeof(qcthread_t));
1039 //copy out the functions stack.
1040 for (i = 0,localsoffset=0; i < ed; i++)
1042 if (i+1 == pr_depth)
1045 f = pr_stack[i+1].f;
1046 localsoffset += f->locals; //this is where it crashes
1048 baselocalsoffset = localsoffset;
1049 for (i = ed; i < pr_depth; i++)
1051 thread->fstack[i-ed].fnum = pr_stack[i].f - pr_progstate[pr_stack[i].progsnum].functions;
1052 thread->fstack[i-ed].progsnum = pr_stack[i].progsnum;
1053 thread->fstack[i-ed].statement = pr_stack[i].s;
1055 if (i+1 == pr_depth)
1058 f = pr_stack[i+1].f;
1059 localsoffset += f->locals;
1061 thread->fstackdepth = pr_depth - ed;
1063 for (i = pr_depth - 1; i >= ed ; i--)
1065 if (i+1 == pr_depth)
1068 f = pr_stack[i+1].f;
1069 localsoffset -= f->locals;
1070 for (l = 0; l < f->locals; l++)
1072 thread->lstack[localsoffset-baselocalsoffset + l ] = ((int *)pr_globals)[f->parm_start + l];
1073 ((int *)pr_globals)[f->parm_start + l] = localstack[localsoffset+l]; //copy the old value into the globals (so the older functions have the correct locals.
1077 for (i = ed; i < pr_depth ; i++) //we need to get the locals back to how they were.
1079 if (i+1 == pr_depth)
1082 f = pr_stack[i+1].f;
1084 for (l = 0; l < f->locals; l++)
1086 ((int *)pr_globals)[f->parm_start + l] = thread->lstack[localsoffset-baselocalsoffset + l];
1088 localsoffset += f->locals;
1090 thread->lstackused = localsoffset - baselocalsoffset;
1092 thread->xstatement = pr_xstatement;
1093 thread->xfunction = pr_xfunction - pr_progstate[pr_typecurrent].functions;
1094 thread->xprogs = pr_typecurrent;
1099 void PR_ResumeThread (progfuncs_t *progfuncs, struct qcthread_s *thread)
1101 dfunction_t *f, *oldf;
1103 progsnum_t initial_progs;
1109 progsnum_t prnum = thread->xprogs;
1110 int fnum = thread->xfunction;
1112 if (localstack_used + thread->lstackused > LOCALSTACK_SIZE)
1113 PR_RunError(progfuncs, "Too many locals on resumtion of QC thread\n");
1115 if (pr_depth + thread->fstackdepth > MAX_STACK_DEPTH)
1116 PR_RunError(progfuncs, "Too large stack on resumtion of QC thread\n");
1119 //do progs switching stuff as appropriate. (fteqw only)
1120 initial_progs = pr_typecurrent;
1121 PR_MoveParms(progfuncs, prnum, pr_typecurrent);
1122 PR_SwitchProgs(progfuncs, prnum);
1125 oldexitdepth = prinst->exitdepth;
1126 prinst->exitdepth = pr_depth;
1129 //add on the callstack.
1130 for (i = 0; i < thread->fstackdepth; i++)
1132 if (pr_depth == prinst->exitdepth)
1134 pr_stack[pr_depth].f = pr_xfunction;
1135 pr_stack[pr_depth].s = pr_xstatement;
1136 pr_stack[pr_depth].progsnum = initial_progs;
1140 pr_stack[pr_depth].progsnum = thread->fstack[i].progsnum;
1141 pr_stack[pr_depth].f = pr_progstate[thread->fstack[i].progsnum].functions + thread->fstack[i].fnum;
1142 pr_stack[pr_depth].s = thread->fstack[i].statement;
1145 if (i+1 == thread->fstackdepth)
1146 f = &pr_functions[fnum];
1148 f = pr_progstate[thread->fstack[i+1].progsnum].functions + thread->fstack[i+1].fnum;
1149 for (l = 0; l < f->locals; l++)
1151 localstack[localstack_used++] = ((int *)pr_globals)[f->parm_start + l];
1152 ((int *)pr_globals)[f->parm_start + l] = thread->lstack[ls++];
1158 if (ls != thread->lstackused)
1159 PR_RunError(progfuncs, "Thread stores incorrect locals count\n");
1162 f = &pr_functions[fnum];
1164 // thread->lstackused -= f->locals; //the current function is the odd one out.
1166 //add on the locals stack
1167 memcpy(localstack+localstack_used, thread->lstack, sizeof(int)*thread->lstackused);
1168 localstack_used += thread->lstackused;
1170 //bung the locals of the current function on the stack.
1171 // for (i=0 ; i < f->locals ; i++)
1172 // ((int *)pr_globals)[f->parm_start + i] = 0xff00ff00;//thread->lstack[thread->lstackused+i];
1175 // PR_EnterFunction (progfuncs, f, initial_progs);
1176 oldf = pr_xfunction;
1178 s = thread->xstatement;
1180 tempdepth = prinst->numtempstringsstack;
1181 PR_ExecuteCode(progfuncs, s);
1184 PR_MoveParms(progfuncs, initial_progs, pr_typecurrent);
1185 PR_SwitchProgs(progfuncs, initial_progs);
1186 PR_FreeTemps(progfuncs, tempdepth);
1187 prinst->numtempstringsstack = tempdepth;
1189 prinst->exitdepth = oldexitdepth;
1190 pr_xfunction = oldf;
1193 void PR_AbortStack (progfuncs_t *progfuncs)
1195 while(pr_depth > prinst->exitdepth+1)
1196 PR_LeaveFunction(progfuncs);
1197 prinst->continuestatement = 0;