]> icculus.org git repositories - divverent/darkplaces.git/blob - pr_execprogram.h
Don't allow sound extra updates until the sounds have been spatialized (fix the noise...
[divverent/darkplaces.git] / pr_execprogram.h
1
2 // This code isn't #ifdef/#define protectable, don't try.
3
4                 while (1)
5                 {
6                         st++;
7                         if (++profile > 10000000) // LordHavoc: increased runaway loop limit 100x
8                         {
9                                 // LordHavoc: update profile counter for debugging reasons
10                                 // (identifying erroneous loops and recursion patterns)
11                                 pr_xfunction->profile += profile - startprofile;
12                                 startprofile = profile;
13                                 // update the statement number before we error out
14                                 pr_xstatement = st - pr_statements;
15                                 Host_Error("runaway loop counter hit limit of %d opcodes\ntip: if having trouble identifying the problem, try typing profile now", profile);
16                         }
17
18 #if PRTRACE
19                         pr_xfunction->profile += profile - startprofile;
20                         startprofile = profile;
21                         pr_xstatement = st - pr_statements;
22                         PR_PrintStatement(st);
23 #endif
24
25                         switch (st->op)
26                         {
27                         case OP_ADD_F:
28                                 OPC->_float = OPA->_float + OPB->_float;
29                                 break;
30                         case OP_ADD_V:
31                                 OPC->vector[0] = OPA->vector[0] + OPB->vector[0];
32                                 OPC->vector[1] = OPA->vector[1] + OPB->vector[1];
33                                 OPC->vector[2] = OPA->vector[2] + OPB->vector[2];
34                                 break;
35                         case OP_SUB_F:
36                                 OPC->_float = OPA->_float - OPB->_float;
37                                 break;
38                         case OP_SUB_V:
39                                 OPC->vector[0] = OPA->vector[0] - OPB->vector[0];
40                                 OPC->vector[1] = OPA->vector[1] - OPB->vector[1];
41                                 OPC->vector[2] = OPA->vector[2] - OPB->vector[2];
42                                 break;
43                         case OP_MUL_F:
44                                 OPC->_float = OPA->_float * OPB->_float;
45                                 break;
46                         case OP_MUL_V:
47                                 OPC->_float = OPA->vector[0]*OPB->vector[0] + OPA->vector[1]*OPB->vector[1] + OPA->vector[2]*OPB->vector[2];
48                                 break;
49                         case OP_MUL_FV:
50                                 OPC->vector[0] = OPA->_float * OPB->vector[0];
51                                 OPC->vector[1] = OPA->_float * OPB->vector[1];
52                                 OPC->vector[2] = OPA->_float * OPB->vector[2];
53                                 break;
54                         case OP_MUL_VF:
55                                 OPC->vector[0] = OPB->_float * OPA->vector[0];
56                                 OPC->vector[1] = OPB->_float * OPA->vector[1];
57                                 OPC->vector[2] = OPB->_float * OPA->vector[2];
58                                 break;
59                         case OP_DIV_F:
60                                 OPC->_float = OPA->_float / OPB->_float;
61                                 break;
62                         case OP_BITAND:
63                                 OPC->_float = (int)OPA->_float & (int)OPB->_float;
64                                 break;
65                         case OP_BITOR:
66                                 OPC->_float = (int)OPA->_float | (int)OPB->_float;
67                                 break;
68                         case OP_GE:
69                                 OPC->_float = OPA->_float >= OPB->_float;
70                                 break;
71                         case OP_LE:
72                                 OPC->_float = OPA->_float <= OPB->_float;
73                                 break;
74                         case OP_GT:
75                                 OPC->_float = OPA->_float > OPB->_float;
76                                 break;
77                         case OP_LT:
78                                 OPC->_float = OPA->_float < OPB->_float;
79                                 break;
80                         case OP_AND:
81                                 OPC->_float = OPA->_float && OPB->_float;
82                                 break;
83                         case OP_OR:
84                                 OPC->_float = OPA->_float || OPB->_float;
85                                 break;
86                         case OP_NOT_F:
87                                 OPC->_float = !OPA->_float;
88                                 break;
89                         case OP_NOT_V:
90                                 OPC->_float = !OPA->vector[0] && !OPA->vector[1] && !OPA->vector[2];
91                                 break;
92                         case OP_NOT_S:
93                                 OPC->_float = !OPA->string || !*PR_GetString(OPA->string);
94                                 break;
95                         case OP_NOT_FNC:
96                                 OPC->_float = !OPA->function;
97                                 break;
98                         case OP_NOT_ENT:
99                                 OPC->_float = (OPA->edict == 0);
100                                 break;
101                         case OP_EQ_F:
102                                 OPC->_float = OPA->_float == OPB->_float;
103                                 break;
104                         case OP_EQ_V:
105                                 OPC->_float = (OPA->vector[0] == OPB->vector[0]) && (OPA->vector[1] == OPB->vector[1]) && (OPA->vector[2] == OPB->vector[2]);
106                                 break;
107                         case OP_EQ_S:
108                                 OPC->_float = !strcmp(PR_GetString(OPA->string),PR_GetString(OPB->string));
109                                 break;
110                         case OP_EQ_E:
111                                 OPC->_float = OPA->_int == OPB->_int;
112                                 break;
113                         case OP_EQ_FNC:
114                                 OPC->_float = OPA->function == OPB->function;
115                                 break;
116                         case OP_NE_F:
117                                 OPC->_float = OPA->_float != OPB->_float;
118                                 break;
119                         case OP_NE_V:
120                                 OPC->_float = (OPA->vector[0] != OPB->vector[0]) || (OPA->vector[1] != OPB->vector[1]) || (OPA->vector[2] != OPB->vector[2]);
121                                 break;
122                         case OP_NE_S:
123                                 OPC->_float = strcmp(PR_GetString(OPA->string),PR_GetString(OPB->string));
124                                 break;
125                         case OP_NE_E:
126                                 OPC->_float = OPA->_int != OPB->_int;
127                                 break;
128                         case OP_NE_FNC:
129                                 OPC->_float = OPA->function != OPB->function;
130                                 break;
131
132                 //==================
133                         case OP_STORE_F:
134                         case OP_STORE_ENT:
135                         case OP_STORE_FLD:              // integers
136                         case OP_STORE_S:
137                         case OP_STORE_FNC:              // pointers
138                                 OPB->_int = OPA->_int;
139                                 break;
140                         case OP_STORE_V:
141                                 OPB->ivector[0] = OPA->ivector[0];
142                                 OPB->ivector[1] = OPA->ivector[1];
143                                 OPB->ivector[2] = OPA->ivector[2];
144                                 break;
145
146                         case OP_STOREP_F:
147                         case OP_STOREP_ENT:
148                         case OP_STOREP_FLD:             // integers
149                         case OP_STOREP_S:
150                         case OP_STOREP_FNC:             // pointers
151 #if PRBOUNDSCHECK
152                                 if (OPB->_int < 0 || OPB->_int + 4 > pr_edictareasize)
153                                 {
154                                         pr_xfunction->profile += profile - startprofile;
155                                         startprofile = profile;
156                                         pr_xstatement = st - pr_statements;
157                                         Host_Error("Progs attempted to write to an out of bounds edict (%i)\n", OPB->_int);
158                                         return;
159                                 }
160 #endif
161                                 ptr = (eval_t *)((qbyte *)sv.edictsfields + OPB->_int);
162                                 ptr->_int = OPA->_int;
163                                 break;
164                         case OP_STOREP_V:
165 #if PRBOUNDSCHECK
166                                 if (OPB->_int < 0 || OPB->_int + 12 > pr_edictareasize)
167                                 {
168                                         pr_xfunction->profile += profile - startprofile;
169                                         startprofile = profile;
170                                         pr_xstatement = st - pr_statements;
171                                         Host_Error("Progs attempted to write to an out of bounds edict (%i)\n", OPB->_int);
172                                         return;
173                                 }
174 #endif
175                                 ptr = (eval_t *)((qbyte *)sv.edictsfields + OPB->_int);
176                                 ptr->vector[0] = OPA->vector[0];
177                                 ptr->vector[1] = OPA->vector[1];
178                                 ptr->vector[2] = OPA->vector[2];
179                                 break;
180
181                         case OP_ADDRESS:
182 #if PRBOUNDSCHECK
183                                 if ((unsigned int)(OPB->_int) >= (unsigned int)(progs->entityfields))
184                                 {
185                                         pr_xfunction->profile += profile - startprofile;
186                                         startprofile = profile;
187                                         pr_xstatement = st - pr_statements;
188                                         Host_Error("Progs attempted to address an invalid field (%i) in an edict\n", OPB->_int);
189                                         return;
190                                 }
191 #endif
192                                 if (OPA->edict == 0 && sv.state == ss_active)
193                                 {
194                                         pr_xfunction->profile += profile - startprofile;
195                                         startprofile = profile;
196                                         pr_xstatement = st - pr_statements;
197                                         Host_Error("assignment to world entity");
198                                         return;
199                                 }
200                                 ed = PROG_TO_EDICT(OPA->edict);
201                                 OPC->_int = (qbyte *)((int *)ed->v + OPB->_int) - (qbyte *)sv.edictsfields;
202                                 break;
203
204                         case OP_LOAD_F:
205                         case OP_LOAD_FLD:
206                         case OP_LOAD_ENT:
207                         case OP_LOAD_S:
208                         case OP_LOAD_FNC:
209 #if PRBOUNDSCHECK
210                                 if ((unsigned int)(OPB->_int) >= (unsigned int)(progs->entityfields))
211                                 {
212                                         pr_xfunction->profile += profile - startprofile;
213                                         startprofile = profile;
214                                         pr_xstatement = st - pr_statements;
215                                         Host_Error("Progs attempted to read an invalid field in an edict (%i)\n", OPB->_int);
216                                         return;
217                                 }
218 #endif
219                                 ed = PROG_TO_EDICT(OPA->edict);
220                                 OPC->_int = ((eval_t *)((int *)ed->v + OPB->_int))->_int;
221                                 break;
222
223                         case OP_LOAD_V:
224 #if PRBOUNDSCHECK
225                                 if (OPB->_int < 0 || OPB->_int + 2 >= progs->entityfields)
226                                 {
227                                         pr_xfunction->profile += profile - startprofile;
228                                         startprofile = profile;
229                                         pr_xstatement = st - pr_statements;
230                                         Host_Error("Progs attempted to read an invalid field in an edict (%i)\n", OPB->_int);
231                                         return;
232                                 }
233 #endif
234                                 ed = PROG_TO_EDICT(OPA->edict);
235                                 OPC->vector[0] = ((eval_t *)((int *)ed->v + OPB->_int))->vector[0];
236                                 OPC->vector[1] = ((eval_t *)((int *)ed->v + OPB->_int))->vector[1];
237                                 OPC->vector[2] = ((eval_t *)((int *)ed->v + OPB->_int))->vector[2];
238                                 break;
239
240                 //==================
241
242                         case OP_IFNOT:
243                                 if (!OPA->_int)
244                                         st += st->b - 1;        // offset the s++
245                                 break;
246
247                         case OP_IF:
248                                 if (OPA->_int)
249                                         st += st->b - 1;        // offset the s++
250                                 break;
251
252                         case OP_GOTO:
253                                 st += st->a - 1;        // offset the s++
254                                 break;
255
256                         case OP_CALL0:
257                         case OP_CALL1:
258                         case OP_CALL2:
259                         case OP_CALL3:
260                         case OP_CALL4:
261                         case OP_CALL5:
262                         case OP_CALL6:
263                         case OP_CALL7:
264                         case OP_CALL8:
265                                 pr_xfunction->profile += profile - startprofile;
266                                 startprofile = profile;
267                                 pr_xstatement = st - pr_statements;
268                                 pr_argc = st->op - OP_CALL0;
269                                 if (!OPA->function)
270                                         Host_Error("NULL function");
271
272                                 newf = &pr_functions[OPA->function];
273
274                                 if (newf->first_statement < 0)
275                                 {
276                                         // negative statements are built in functions
277                                         int builtinnumber = -newf->first_statement;
278                                         pr_xfunction->builtinsprofile++;
279                                         if (builtinnumber < pr_numbuiltins && pr_builtins[builtinnumber])
280                                                 pr_builtins[builtinnumber]();
281                                         else
282                                                 Host_Error("No such builtin #%i", builtinnumber);
283                                 }
284                                 else
285                                         st = pr_statements + PR_EnterFunction(newf);
286                                 if (pr_trace != cachedpr_trace)
287                                         goto chooseexecprogram;
288                                 break;
289
290                         case OP_DONE:
291                         case OP_RETURN:
292                                 pr_xfunction->profile += profile - startprofile;
293                                 startprofile = profile;
294                                 pr_xstatement = st - pr_statements;
295
296                                 pr_globals[OFS_RETURN] = pr_globals[(unsigned short) st->a];
297                                 pr_globals[OFS_RETURN+1] = pr_globals[(unsigned short) st->a+1];
298                                 pr_globals[OFS_RETURN+2] = pr_globals[(unsigned short) st->a+2];
299
300                                 st = pr_statements + PR_LeaveFunction();
301                                 if (pr_depth <= exitdepth)
302                                         return;         // all done
303                                 if (pr_trace != cachedpr_trace)
304                                         goto chooseexecprogram;
305                                 break;
306
307                         case OP_STATE:
308                                 pr_xfunction->profile += profile - startprofile;
309                                 startprofile = profile;
310                                 pr_xstatement = st - pr_statements;
311                                 ed = PROG_TO_EDICT(pr_global_struct->self);
312                                 ed->v->nextthink = pr_global_struct->time + 0.1;
313                                 ed->v->frame = OPA->_float;
314                                 ed->v->think = OPB->function;
315                                 break;
316
317 // LordHavoc: to be enabled when Progs version 7 (or whatever it will be numbered) is finalized
318 /*
319                         case OP_ADD_I:
320                                 OPC->_int = OPA->_int + OPB->_int;
321                                 break;
322                         case OP_ADD_IF:
323                                 OPC->_int = OPA->_int + (int) OPB->_float;
324                                 break;
325                         case OP_ADD_FI:
326                                 OPC->_float = OPA->_float + (float) OPB->_int;
327                                 break;
328                         case OP_SUB_I:
329                                 OPC->_int = OPA->_int - OPB->_int;
330                                 break;
331                         case OP_SUB_IF:
332                                 OPC->_int = OPA->_int - (int) OPB->_float;
333                                 break;
334                         case OP_SUB_FI:
335                                 OPC->_float = OPA->_float - (float) OPB->_int;
336                                 break;
337                         case OP_MUL_I:
338                                 OPC->_int = OPA->_int * OPB->_int;
339                                 break;
340                         case OP_MUL_IF:
341                                 OPC->_int = OPA->_int * (int) OPB->_float;
342                                 break;
343                         case OP_MUL_FI:
344                                 OPC->_float = OPA->_float * (float) OPB->_int;
345                                 break;
346                         case OP_MUL_VI:
347                                 OPC->vector[0] = (float) OPB->_int * OPA->vector[0];
348                                 OPC->vector[1] = (float) OPB->_int * OPA->vector[1];
349                                 OPC->vector[2] = (float) OPB->_int * OPA->vector[2];
350                                 break;
351                         case OP_DIV_VF:
352                                 {
353                                         float temp = 1.0f / OPB->_float;
354                                         OPC->vector[0] = temp * OPA->vector[0];
355                                         OPC->vector[1] = temp * OPA->vector[1];
356                                         OPC->vector[2] = temp * OPA->vector[2];
357                                 }
358                                 break;
359                         case OP_DIV_I:
360                                 OPC->_int = OPA->_int / OPB->_int;
361                                 break;
362                         case OP_DIV_IF:
363                                 OPC->_int = OPA->_int / (int) OPB->_float;
364                                 break;
365                         case OP_DIV_FI:
366                                 OPC->_float = OPA->_float / (float) OPB->_int;
367                                 break;
368                         case OP_CONV_IF:
369                                 OPC->_float = OPA->_int;
370                                 break;
371                         case OP_CONV_FI:
372                                 OPC->_int = OPA->_float;
373                                 break;
374                         case OP_BITAND_I:
375                                 OPC->_int = OPA->_int & OPB->_int;
376                                 break;
377                         case OP_BITOR_I:
378                                 OPC->_int = OPA->_int | OPB->_int;
379                                 break;
380                         case OP_BITAND_IF:
381                                 OPC->_int = OPA->_int & (int)OPB->_float;
382                                 break;
383                         case OP_BITOR_IF:
384                                 OPC->_int = OPA->_int | (int)OPB->_float;
385                                 break;
386                         case OP_BITAND_FI:
387                                 OPC->_float = (int)OPA->_float & OPB->_int;
388                                 break;
389                         case OP_BITOR_FI:
390                                 OPC->_float = (int)OPA->_float | OPB->_int;
391                                 break;
392                         case OP_GE_I:
393                                 OPC->_float = OPA->_int >= OPB->_int;
394                                 break;
395                         case OP_LE_I:
396                                 OPC->_float = OPA->_int <= OPB->_int;
397                                 break;
398                         case OP_GT_I:
399                                 OPC->_float = OPA->_int > OPB->_int;
400                                 break;
401                         case OP_LT_I:
402                                 OPC->_float = OPA->_int < OPB->_int;
403                                 break;
404                         case OP_AND_I:
405                                 OPC->_float = OPA->_int && OPB->_int;
406                                 break;
407                         case OP_OR_I:
408                                 OPC->_float = OPA->_int || OPB->_int;
409                                 break;
410                         case OP_GE_IF:
411                                 OPC->_float = (float)OPA->_int >= OPB->_float;
412                                 break;
413                         case OP_LE_IF:
414                                 OPC->_float = (float)OPA->_int <= OPB->_float;
415                                 break;
416                         case OP_GT_IF:
417                                 OPC->_float = (float)OPA->_int > OPB->_float;
418                                 break;
419                         case OP_LT_IF:
420                                 OPC->_float = (float)OPA->_int < OPB->_float;
421                                 break;
422                         case OP_AND_IF:
423                                 OPC->_float = (float)OPA->_int && OPB->_float;
424                                 break;
425                         case OP_OR_IF:
426                                 OPC->_float = (float)OPA->_int || OPB->_float;
427                                 break;
428                         case OP_GE_FI:
429                                 OPC->_float = OPA->_float >= (float)OPB->_int;
430                                 break;
431                         case OP_LE_FI:
432                                 OPC->_float = OPA->_float <= (float)OPB->_int;
433                                 break;
434                         case OP_GT_FI:
435                                 OPC->_float = OPA->_float > (float)OPB->_int;
436                                 break;
437                         case OP_LT_FI:
438                                 OPC->_float = OPA->_float < (float)OPB->_int;
439                                 break;
440                         case OP_AND_FI:
441                                 OPC->_float = OPA->_float && (float)OPB->_int;
442                                 break;
443                         case OP_OR_FI:
444                                 OPC->_float = OPA->_float || (float)OPB->_int;
445                                 break;
446                         case OP_NOT_I:
447                                 OPC->_float = !OPA->_int;
448                                 break;
449                         case OP_EQ_I:
450                                 OPC->_float = OPA->_int == OPB->_int;
451                                 break;
452                         case OP_EQ_IF:
453                                 OPC->_float = (float)OPA->_int == OPB->_float;
454                                 break;
455                         case OP_EQ_FI:
456                                 OPC->_float = OPA->_float == (float)OPB->_int;
457                                 break;
458                         case OP_NE_I:
459                                 OPC->_float = OPA->_int != OPB->_int;
460                                 break;
461                         case OP_NE_IF:
462                                 OPC->_float = (float)OPA->_int != OPB->_float;
463                                 break;
464                         case OP_NE_FI:
465                                 OPC->_float = OPA->_float != (float)OPB->_int;
466                                 break;
467                         case OP_STORE_I:
468                                 OPB->_int = OPA->_int;
469                                 break;
470                         case OP_STOREP_I:
471 #if PRBOUNDSCHECK
472                                 if (OPB->_int < 0 || OPB->_int + 4 > pr_edictareasize)
473                                 {
474                                         pr_xfunction->profile += profile - startprofile;
475                                         startprofile = profile;
476                                         pr_xstatement = st - pr_statements;
477                                         Host_Error("Progs attempted to write to an out of bounds edict\n");
478                                         return;
479                                 }
480 #endif
481                                 ptr = (eval_t *)((qbyte *)sv.edictsfields + OPB->_int);
482                                 ptr->_int = OPA->_int;
483                                 break;
484                         case OP_LOAD_I:
485 #if PRBOUNDSCHECK
486                                 if (OPA->edict < 0 || OPA->edict >= pr_edictareasize)
487                                 {
488                                         pr_xfunction->profile += profile - startprofile;
489                                         startprofile = profile;
490                                         pr_xstatement = st - pr_statements;
491                                         Host_Error("Progs attempted to read an out of bounds edict number\n");
492                                         return;
493                                 }
494                                 if (OPB->_int < 0 || OPB->_int >= progs->entityfields)
495                                 {
496                                         pr_xfunction->profile += profile - startprofile;
497                                         startprofile = profile;
498                                         pr_xstatement = st - pr_statements;
499                                         Host_Error("Progs attempted to read an invalid field in an edict\n");
500                                         return;
501                                 }
502 #endif
503                                 ed = PROG_TO_EDICT(OPA->edict);
504                                 OPC->_int = ((eval_t *)((int *)ed->v + OPB->_int))->_int;
505                                 break;
506
507                         case OP_GSTOREP_I:
508                         case OP_GSTOREP_F:
509                         case OP_GSTOREP_ENT:
510                         case OP_GSTOREP_FLD:            // integers
511                         case OP_GSTOREP_S:
512                         case OP_GSTOREP_FNC:            // pointers
513 #if PRBOUNDSCHECK
514                                 if (OPB->_int < 0 || OPB->_int >= pr_globaldefs)
515                                 {
516                                         pr_xfunction->profile += profile - startprofile;
517                                         startprofile = profile;
518                                         pr_xstatement = st - pr_statements;
519                                         Host_Error("Progs attempted to write to an invalid indexed global\n");
520                                         return;
521                                 }
522 #endif
523                                 pr_globals[OPB->_int] = OPA->_float;
524                                 break;
525                         case OP_GSTOREP_V:
526 #if PRBOUNDSCHECK
527                                 if (OPB->_int < 0 || OPB->_int + 2 >= pr_globaldefs)
528                                 {
529                                         pr_xfunction->profile += profile - startprofile;
530                                         startprofile = profile;
531                                         pr_xstatement = st - pr_statements;
532                                         Host_Error("Progs attempted to write to an invalid indexed global\n");
533                                         return;
534                                 }
535 #endif
536                                 pr_globals[OPB->_int  ] = OPA->vector[0];
537                                 pr_globals[OPB->_int+1] = OPA->vector[1];
538                                 pr_globals[OPB->_int+2] = OPA->vector[2];
539                                 break;
540
541                         case OP_GADDRESS:
542                                 i = OPA->_int + (int) OPB->_float;
543 #if PRBOUNDSCHECK
544                                 if (i < 0 || i >= pr_globaldefs)
545                                 {
546                                         pr_xfunction->profile += profile - startprofile;
547                                         startprofile = profile;
548                                         pr_xstatement = st - pr_statements;
549                                         Host_Error("Progs attempted to address an out of bounds global\n");
550                                         return;
551                                 }
552 #endif
553                                 OPC->_float = pr_globals[i];
554                                 break;
555
556                         case OP_GLOAD_I:
557                         case OP_GLOAD_F:
558                         case OP_GLOAD_FLD:
559                         case OP_GLOAD_ENT:
560                         case OP_GLOAD_S:
561                         case OP_GLOAD_FNC:
562 #if PRBOUNDSCHECK
563                                 if (OPA->_int < 0 || OPA->_int >= pr_globaldefs)
564                                 {
565                                         pr_xfunction->profile += profile - startprofile;
566                                         startprofile = profile;
567                                         pr_xstatement = st - pr_statements;
568                                         Host_Error("Progs attempted to read an invalid indexed global\n");
569                                         return;
570                                 }
571 #endif
572                                 OPC->_float = pr_globals[OPA->_int];
573                                 break;
574
575                         case OP_GLOAD_V:
576 #if PRBOUNDSCHECK
577                                 if (OPA->_int < 0 || OPA->_int + 2 >= pr_globaldefs)
578                                 {
579                                         pr_xfunction->profile += profile - startprofile;
580                                         startprofile = profile;
581                                         pr_xstatement = st - pr_statements;
582                                         Host_Error("Progs attempted to read an invalid indexed global\n");
583                                         return;
584                                 }
585 #endif
586                                 OPC->vector[0] = pr_globals[OPA->_int  ];
587                                 OPC->vector[1] = pr_globals[OPA->_int+1];
588                                 OPC->vector[2] = pr_globals[OPA->_int+2];
589                                 break;
590
591                         case OP_BOUNDCHECK:
592                                 if (OPA->_int < 0 || OPA->_int >= st->b)
593                                 {
594                                         pr_xfunction->profile += profile - startprofile;
595                                         startprofile = profile;
596                                         pr_xstatement = st - pr_statements;
597                                         Host_Error("Progs boundcheck failed at line number %d, value is < 0 or >= %d\n", st->b, st->c);
598                                         return;
599                                 }
600                                 break;
601
602 */
603
604                         default:
605                                 pr_xfunction->profile += profile - startprofile;
606                                 startprofile = profile;
607                                 pr_xstatement = st - pr_statements;
608                                 Host_Error ("Bad opcode %i", st->op);
609                         }
610                 }
611