mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 00:30:57 +00:00
pr_comp.h:
o add OP_JUMPB o OP_JUMPB renumberd some opcodes, so up PROG_VERSION pr_edict.c: o make the version error reporting more informative pr_exec.c: o implement OP_JUMPB (goto *(ptr + index)) pr_opcode.c: (libs/gamecode/engine) o add OP_JUMPB to the table expr.h: o ex_uinteger support o some const correctness o prototype new_label_expr qfcc.h: o uinteger ussport o add pointers for op_jump and op_jumpb o prototype PR_GetArray emit.c: o general uinteger support o new reference/reloc type 3: absolute statement address o jumpb support (binary goto) expr.c: o uinteger support o break the label name creation out of new_label_expr into new_label_name o some const correctness pr_def.c: o add PR_GetArray to allocate an array in global space o factor out some code common to PR_GetDef and PR_GetArray that would otherwise be duplicated pr_imm.c: o some const correctness o uinteger support pr_lex.c: o uinteger support pr_opcode.c: (tools/qfcc/source) o support jump and jumpb switch.c: o rewrite the binary search code to support ranges.
This commit is contained in:
parent
748dc49218
commit
07b59d2f07
13 changed files with 318 additions and 60 deletions
|
@ -623,6 +623,19 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
|
|||
}
|
||||
st = &pr->pr_statements[OPA.uinteger_var];
|
||||
break;
|
||||
case OP_JUMPB:
|
||||
//FIXME put bounds checking in
|
||||
pointer = OPA.integer_var + OPB.integer_var;
|
||||
ptr = pr->pr_globals + pointer;
|
||||
pointer = ptr->integer_var;
|
||||
if (pr_boundscheck->int_val
|
||||
&& (pointer >= pr->progs->numstatements)) {
|
||||
pr->pr_xstatement = st - pr->pr_statements;
|
||||
PR_RunError (pr, "Invalid jump destination\n");
|
||||
return;
|
||||
}
|
||||
st = &pr->pr_statements[pointer];
|
||||
break;
|
||||
|
||||
case OP_CALL0:
|
||||
case OP_CALL1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue