diff options
author | Brian <[email protected]> | 2007-07-24 16:50:46 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-07-24 16:50:46 -0600 |
commit | 2eb9061f73523c3cfc2d77db789afa804c68ee7f (patch) | |
tree | a67e39b48181dc9d15ed0d1018f3a36acf6aa8cf /src | |
parent | ed52adc64ed13583162a997f13f3bc4624feb5ee (diff) |
check return value of tgsi_parse_init()
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/pipe/tgsi/core/tgsi_exec.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/mesa/pipe/tgsi/core/tgsi_exec.c b/src/mesa/pipe/tgsi/core/tgsi_exec.c index 189a41167a9..74734beb393 100644 --- a/src/mesa/pipe/tgsi/core/tgsi_exec.c +++ b/src/mesa/pipe/tgsi/core/tgsi_exec.c @@ -57,12 +57,17 @@ tgsi_exec_machine_init( struct tgsi_exec_machine *mach, struct tgsi_token *tokens ) { - GLuint i; + GLuint i, k; struct tgsi_parse_context parse; mach->Tokens = tokens; - tgsi_parse_init (&parse, mach->Tokens); + k = tgsi_parse_init (&parse, mach->Tokens); + if (k != TGSI_PARSE_OK) { + printf("Problem parsing!\n"); + return; + } + mach->Processor = parse.FullHeader.Processor.Processor; tgsi_parse_free (&parse); @@ -93,11 +98,17 @@ tgsi_exec_prepare( struct tgsi_exec_labels *labels ) { struct tgsi_parse_context parse; + GLuint k; mach->ImmLimit = 0; labels->count = 0; - tgsi_parse_init( &parse, mach->Tokens ); + k = tgsi_parse_init( &parse, mach->Tokens ); + if (k != TGSI_PARSE_OK) { + printf("Problem parsing!\n"); + return; + } + while( !tgsi_parse_end_of_tokens( &parse ) ) { GLuint pointer = parse.Position; GLuint i; @@ -2153,6 +2164,7 @@ tgsi_exec_machine_run2( mach->Temps); #else struct tgsi_parse_context parse; + GLuint k; mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] = 0; mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0] = 0; @@ -2162,7 +2174,12 @@ tgsi_exec_machine_run2( mach->Primitives[0] = 0; } - tgsi_parse_init( &parse, mach->Tokens ); + k = tgsi_parse_init( &parse, mach->Tokens ); + if (k != TGSI_PARSE_OK) { + printf("Problem parsing!\n"); + return; + } + while( !tgsi_parse_end_of_tokens( &parse ) ) { tgsi_parse_token( &parse ); switch( parse.FullToken.Token.Type ) { |