mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[qfcc] Create alias def for defs accessed via pointer
This the fixes the incorrect flow analysis caused by the def being seen to have the wrong size (structure field of structure def seen through a constant pointer). Fixes the ICE, but the pointer constant is broken somewhere in dags, presumably.
This commit is contained in:
parent
faa6eabfbe
commit
48514ba2f3
2 changed files with 10 additions and 2 deletions
|
@ -859,8 +859,10 @@ flow_analyze_statement (statement_t *s, set_t *use, set_t *def, set_t *kill,
|
|||
&& s->opc->o.value->lltype == ev_pointer
|
||||
&& s->opc->o.value->v.pointer.def) {
|
||||
operand_t *op;
|
||||
def_t *alias;
|
||||
ex_pointer_t *ptr = &s->opc->o.value->v.pointer;
|
||||
op = def_operand (ptr->def, ptr->type);
|
||||
alias = alias_def (ptr->def, ptr->type, ptr->val);
|
||||
op = def_operand (alias, ptr->type);
|
||||
flow_add_op_var (def, op);
|
||||
if (operands)
|
||||
operands[0] = op;
|
||||
|
|
|
@ -103,7 +103,13 @@ operand_string (operand_t *op)
|
|||
op->o.value->v.quaternion_val[2],
|
||||
op->o.value->v.quaternion_val[3]);
|
||||
case ev_pointer:
|
||||
return va ("ptr %d", op->o.value->v.pointer.val);
|
||||
if (op->o.value->v.pointer.def) {
|
||||
return va ("ptr %s+%d",
|
||||
op->o.value->v.pointer.def->name,
|
||||
op->o.value->v.pointer.val);
|
||||
} else {
|
||||
return va ("ptr %d", op->o.value->v.pointer.val);
|
||||
}
|
||||
case ev_field:
|
||||
return va ("field %d", op->o.value->v.pointer.val);
|
||||
case ev_entity:
|
||||
|
|
Loading…
Reference in a new issue