tgsi: Make tgsi_sanity.c compile with make
authorJakob Bornecrantz <jakob@tungstengraphics.com>
Tue, 16 Sep 2008 14:16:54 +0000 (16:16 +0200)
committerJakob Bornecrantz <jakob@tungstengraphics.com>
Tue, 16 Sep 2008 14:20:19 +0000 (16:20 +0200)
src/gallium/auxiliary/tgsi/Makefile
src/gallium/auxiliary/tgsi/tgsi_sanity.c

index 806a2bd4c52b1ab78b94cccadfd28dbb3e3c2328..c5d2082087c2b8644cca0fbf9230850e16555c0a 100644 (file)
@@ -4,6 +4,7 @@ include $(TOP)/configs/current
 LIBNAME = tgsi
 
 C_SOURCES = \
+       tgsi_sanity.c \
        tgsi_build.c \
        tgsi_dump.c \
        tgsi_exec.c \
index c6590272969c80e1d866ae4a590716fb7f14027e..20b32477be3558b05d3e6dc9228a070d70e90a8c 100644 (file)
@@ -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 );