[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:
Bill Currie 2023-10-02 20:42:53 +09:00
parent 4952d298ac
commit ef807f411e

View file

@ -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");