gallium: memset() tgsi_exec_machine to all zeros in tgsi_exec_machine_create()
authorBrian Paul <brianp@vmware.com>
Mon, 17 Aug 2009 23:11:54 +0000 (17:11 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 17 Aug 2009 23:13:17 +0000 (17:13 -0600)
This fixes invalid values for CondStackTop, LoopStackTop, etc.

src/gallium/auxiliary/tgsi/tgsi_exec.c

index 5af0a94..951ecfd 100644 (file)
@@ -375,15 +375,9 @@ tgsi_exec_machine_create( void )
    if (!mach)
       goto fail;
 
-   mach->Addrs = &mach->Temps[TGSI_EXEC_TEMP_ADDR];
+   memset(mach, 0, sizeof(*mach));
 
-   mach->Samplers = NULL;
-   mach->Consts = NULL;
-   mach->Tokens = NULL;
-   mach->Primitives = NULL;
-   mach->InterpCoefs = NULL;
-   mach->Instructions = NULL;
-   mach->Declarations = NULL;
+   mach->Addrs = &mach->Temps[TGSI_EXEC_TEMP_ADDR];
 
    /* Setup constants. */
    for( i = 0; i < 4; i++ ) {