tgsi: Perform a sanity check after reading a shader from text.
authorMichal Krol <michal@tungstengraphics.com>
Thu, 17 Jul 2008 18:23:26 +0000 (20:23 +0200)
committerMichal Krol <michal@tungstengraphics.com>
Thu, 17 Jul 2008 18:23:26 +0000 (20:23 +0200)
src/gallium/auxiliary/tgsi/util/tgsi_text.c

index 6cab475b8893fb8eb5eec4ebffdea5ff38bfeb55..803f7a23b8e218f0d9d72c57c314b9533f59b590 100644 (file)
@@ -29,6 +29,7 @@
 #include "tgsi_text.h"
 #include "tgsi_build.h"
 #include "tgsi_parse.h"
+#include "tgsi_sanity.h"
 #include "tgsi_util.h"
 
 static boolean is_alpha_underscore( const char *cur )
@@ -1064,5 +1065,8 @@ tgsi_text_translate(
    ctx.tokens_cur = tokens;
    ctx.tokens_end = tokens + num_tokens;
 
-   return translate( &ctx );
+   if (!translate( &ctx ))
+      return FALSE;
+
+   return tgsi_sanity_check( tokens );
 }