change the operator for "address" from "." to "&" so load.p can be implement.

this makes it so pointers in entities work.
This commit is contained in:
Bill Currie 2001-12-08 20:17:20 +00:00
parent a184199146
commit 00b2a45ecd
4 changed files with 6 additions and 1 deletions

View file

@ -239,6 +239,8 @@ typedef enum {
OP_STOREBI_P,
OP_LEAI,
OP_LOAD_P,
} pr_opcode_e;
typedef struct

View file

@ -517,6 +517,7 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
case OP_LOAD_S:
case OP_LOAD_FNC:
case OP_LOAD_I:
case OP_LOAD_P:
if (pr_boundscheck->int_val
&& (OPA.entity_var < 0 || OPA.entity_var >=
pr->pr_edictareasize)) {

View file

@ -91,6 +91,7 @@ opcode_t pr_opcodes[] = {
{".", "load.fld", OP_LOAD_FLD, false, ev_entity, ev_field, ev_field, PROG_ID_VERSION},
{".", "load.fnc", OP_LOAD_FNC, false, ev_entity, ev_field, ev_func, PROG_ID_VERSION},
{".", "load.i", OP_LOAD_I, false, ev_entity, ev_field, ev_integer, PROG_VERSION},
{".", "load.p", OP_LOAD_P, false, ev_entity, ev_field, ev_pointer, PROG_VERSION},
{".", "loadb.f", OP_LOADB_F, false, ev_pointer, ev_integer, ev_float, PROG_VERSION},
{".", "loadb.v", OP_LOADB_V, false, ev_pointer, ev_integer, ev_vector, PROG_VERSION},
@ -110,7 +111,7 @@ opcode_t pr_opcodes[] = {
{".", "loadbi.i", OP_LOADBI_I, false, ev_pointer, ev_short, ev_integer, PROG_VERSION},
{".", "loadbi.p", OP_LOADBI_P, false, ev_pointer, ev_short, ev_pointer, PROG_VERSION},
{".", "address", OP_ADDRESS, false, ev_entity, ev_field, ev_pointer, PROG_ID_VERSION},
{"&", "address", OP_ADDRESS, false, ev_entity, ev_field, ev_pointer, PROG_ID_VERSION},
{"&", "address.f", OP_ADDRESS_F, false, ev_float, ev_void, ev_pointer, PROG_VERSION},
{"&", "address.v", OP_ADDRESS_V, false, ev_vector, ev_void, ev_pointer, PROG_VERSION},

View file

@ -1060,6 +1060,7 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
new.type = ev_pointer;
type = new.aux_type = e1->e.expr.type;
e1->e.expr.type = PR_FindType (&new);
e1->e.expr.op = '&';
}
}
if (!type)