mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-16 06:11:15 +00:00
[qfcc] Check alignment when looking for immediates
I'm not sure why this showed up now (I guess just not enough large immediate values), but this fixes a segfault in the algtypes test (the mystery is why it showed up this late).
This commit is contained in:
parent
4952d298ac
commit
ef807f411e
1 changed files with 3 additions and 0 deletions
|
@ -519,6 +519,9 @@ imm_compare (const void *_imm1, const void *_imm2, void *_tab)
|
|||
sizeof (imm1->i.pointer));
|
||||
} else if (tab == &value_imm_defs) {
|
||||
size_t size = type_size (imm1->def->type) * sizeof (pr_type_t);
|
||||
if (imm1->def->type->alignment != imm2->def->type->alignment) {
|
||||
return 0;
|
||||
}
|
||||
return !memcmp (&imm1->i, &imm2->i, size);
|
||||
} else {
|
||||
internal_error (0, "invalid immediate hash table");
|
||||
|
|
Loading…
Reference in a new issue