mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-03 16:01:38 +00:00
[qfcc] Correct the logic surrounding type attributes
I'd messed up the attribute check when encoding the type (such a frequent occurrence, that) and forgotten to check for null pointer on the list from the hash table. Fixes block member arrays not getting their stride decoration.
This commit is contained in:
parent
151efa5ad7
commit
054fe6e3c6
1 changed files with 3 additions and 3 deletions
|
@ -708,11 +708,11 @@ find_type (const type_t *type)
|
|||
}
|
||||
}
|
||||
|
||||
const type_t *check;
|
||||
const type_t *check = nullptr;
|
||||
if (strchr (type->encoding, '%')) {
|
||||
// type chain has attributes so the encoding may be aliased
|
||||
auto list = (const type_t **) Hash_FindList (type_tab, type->encoding);
|
||||
for (auto c = list; (check = *c); c++) {
|
||||
for (auto c = list; c && (check = *c); c++) {
|
||||
if (types_same (check, type)) {
|
||||
break;
|
||||
}
|
||||
|
@ -1317,7 +1317,7 @@ encode_type (dstring_t *encoding, const type_t *type)
|
|||
{
|
||||
if (!type)
|
||||
return;
|
||||
if (type->attributes && is_func (type) && type->func.attribute_bits) {
|
||||
if (type->attributes || (is_func (type) && type->func.attribute_bits)) {
|
||||
dstring_appendstr (encoding, "%");
|
||||
}
|
||||
switch (type->meta) {
|
||||
|
|
Loading…
Reference in a new issue