pan/bi: Lint for infinite loops

I would make this unconditional, but conditionally branching to the same
clause in a tight loop is (disturbingly) legal, as far as I know.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8723>
This commit is contained in:
Alyssa Rosenzweig 2021-01-20 19:03:44 -05:00 committed by Marge Bot
parent 63c2ee2c4c
commit d3c92d32ba

View file

@ -279,6 +279,11 @@ dump_pc_imm(FILE *fp, uint64_t imm, enum bi_constmod mod, bool high32)
if (mod == BI_CONSTMOD_PC_LO && high32)
fprintf(fp, " >> 32");
/* While technically in spec, referencing the current clause as (pc +
* 0) likely indicates an unintended infinite loop */
if (offs == 0)
fprintf(fp, " /* XXX: likely an infinite loop */");
}
/* Convert an index to an embedded constant in FAU-RAM to the index of the