ir3: Fix list corruption in legalize_block()

We forgot to remove the instruction under consideration from instr_list
before inserting it into the block's list, which caused instr_list to
become corrupted. This happened to work but caused further corruption in
some rare scenarios.

Fixes: adf1659 ("freedreno/ir3: use standard list implementation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
(cherry picked from commit 8e11f0560e)
This commit is contained in:
Connor Abbott 2020-11-10 11:50:29 +01:00 committed by Dylan Baker
parent 2aeb7c0cc4
commit 2a7ad92fc5
2 changed files with 2 additions and 1 deletions

View file

@ -661,7 +661,7 @@
"description": "ir3: Fix list corruption in legalize_block()",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "adf1659ff5f07d907eca552be3b566e408c8601e"
},

View file

@ -230,6 +230,7 @@ legalize_block(struct ir3_legalize_ctx *ctx, struct ir3_block *block)
samgp->flags |= IR3_INSTR_SY;
}
} else {
list_delinit(&n->node);
list_addtail(&n->node, &block->instr_list);
}