cell: move misplaced assertions; put them after ximage is assigned.
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 3 Sep 2008 16:26:38 +0000 (10:26 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 3 Sep 2008 19:35:05 +0000 (13:35 -0600)
src/gallium/winsys/xlib/xm_winsys.c

index 70f01e0ef8310bf6b7e83414a91ce2bf8ce3819b..cc9f49a73166ef5b6d6dfff53f3291b9d7f694d0 100644 (file)
@@ -287,16 +287,16 @@ xmesa_display_surface_tiled(XMesaBuffer b, const struct pipe_surface *surf)
    const uint tilesPerRow = (surf->width + TILE_SIZE - 1) / TILE_SIZE;
    uint x, y;
 
-   /* check that the XImage has been previously initialized */
-   assert(ximage->format);
-   assert(ximage->bitmap_unit);
-
    if (XSHM_ENABLED(xm_buf) && (xm_buf->tempImage == NULL)) {
       alloc_shm_ximage(xm_buf, b, TILE_SIZE, TILE_SIZE);
    }
 
    ximage = (XSHM_ENABLED(xm_buf)) ? xm_buf->tempImage : b->tempImage;
 
+   /* check that the XImage has been previously initialized */
+   assert(ximage->format);
+   assert(ximage->bitmap_unit);
+
    if (!XSHM_ENABLED(xm_buf)) {
       /* update XImage's fields */
       ximage->width = TILE_SIZE;