mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[qfcc] Use full type for differentiating values
This fixes the problem of using nil for two different compound types within the one expression. The problem is all compound types have the same low-level type (ev_invalid) and this caused the two different nils to have the same type when taken back up to expression level.
This commit is contained in:
parent
07e6baf32f
commit
9dbc81432a
1 changed files with 2 additions and 2 deletions
|
@ -80,7 +80,7 @@ static uintptr_t
|
|||
value_get_hash (const void *_val, void *unused)
|
||||
{
|
||||
const ex_value_t *val = (const ex_value_t *) _val;
|
||||
return Hash_Buffer (&val->v, sizeof (val->v)) + val->lltype;
|
||||
return Hash_Buffer (&val->v, sizeof (val->v)) ^ (uintptr_t) val->type;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -88,7 +88,7 @@ value_compare (const void *_val1, const void *_val2, void *unused)
|
|||
{
|
||||
const ex_value_t *val1 = (const ex_value_t *) _val1;
|
||||
const ex_value_t *val2 = (const ex_value_t *) _val2;
|
||||
if (val1->lltype != val2->lltype)
|
||||
if (val1->type != val2->type)
|
||||
return 0;
|
||||
return memcmp (&val1->v, &val2->v, sizeof (val1->v)) == 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue