nir/spirv: fix a bad assertion in the decoration handling

We should be asserting that the parent decoration didn't hand us
a member if the child decoration did, but different child decorations
may obviously have different members.
This commit is contained in:
Connor Abbott 2015-07-04 15:46:58 -07:00
parent 70d2336e7e
commit 73351c6a18
1 changed files with 6 additions and 3 deletions

View File

@ -184,17 +184,20 @@ _foreach_decoration_helper(struct vtn_builder *b,
struct vtn_value *value,
vtn_decoration_foreach_cb cb, void *data)
{
int new_member = member;
for (struct vtn_decoration *dec = value->decoration; dec; dec = dec->next) {
if (dec->member >= 0) {
assert(member == -1);
member = dec->member;
new_member = dec->member;
}
if (dec->group) {
assert(dec->group->value_type == vtn_value_type_decoration_group);
_foreach_decoration_helper(b, base_value, member, dec->group, cb, data);
_foreach_decoration_helper(b, base_value, new_member, dec->group,
cb, data);
} else {
cb(b, base_value, member, dec, data);
cb(b, base_value, new_member, dec, data);
}
}
}