From: Jakob Bornecrantz Date: Tue, 16 Sep 2008 14:16:54 +0000 (+0200) Subject: tgsi: Make tgsi_sanity.c compile with make X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad16ecbbe4fe8c1bcb18ed8fbbd672c68a0b17fa;p=mesa.git tgsi: Make tgsi_sanity.c compile with make --- diff --git a/src/gallium/auxiliary/tgsi/Makefile b/src/gallium/auxiliary/tgsi/Makefile index 806a2bd4c52..c5d2082087c 100644 --- a/src/gallium/auxiliary/tgsi/Makefile +++ b/src/gallium/auxiliary/tgsi/Makefile @@ -4,6 +4,7 @@ include $(TOP)/configs/current LIBNAME = tgsi C_SOURCES = \ + tgsi_sanity.c \ tgsi_build.c \ tgsi_dump.c \ tgsi_exec.c \ diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.c b/src/gallium/auxiliary/tgsi/tgsi_sanity.c index c6590272969..20b32477be3 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sanity.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.c @@ -152,6 +152,12 @@ check_register_usage( { if (!check_file_name( ctx, file )) return FALSE; + + if (index < 0 || index > MAX_REGISTERS) { + report_error( ctx, "%s[%i]: Invalid index %s", file_names[file], index, name ); + return FALSE; + } + if (indirect_access) { if (!is_any_register_declared( ctx, file )) report_error( ctx, "%s: Undeclared %s register", file_names[file], name );