aco: Fix format string used when raising validation errors

Validation errors mention the pretty-printed instruction including
operands with the reserved % character, which caused vasprintf to
expect more format arguments than aco provided.

Fixes: c2b1978aa4 ("aco: rework the way various compilation/validation errors are reported")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7442>
This commit is contained in:
Tony Wasserka 2020-11-04 12:44:10 +01:00 committed by Marge Bot
parent 61d2badbf4
commit 1a1099c54f
1 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ bool validate_ir(Program* program)
aco_print_instr(instr, memf);
u_memstream_close(&mem);
aco_err(program, out);
aco_err(program, "%s", out);
free(out);
is_valid = false;
@ -555,7 +555,7 @@ bool ra_fail(Program *program, Location loc, Location loc2, const char *fmt, ...
fprintf(memf, "\n\n");
u_memstream_close(&mem);
aco_err(program, out);
aco_err(program, "%s", out);
free(out);
return true;