OSDN Git Service

gallivm: (trivial) fix lp_build_concat_n
authorRoland Scheidegger <sroland@vmware.com>
Sat, 1 Jun 2013 18:55:17 +0000 (20:55 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Tue, 4 Jun 2013 22:29:46 +0000 (00:29 +0200)
The code was designed to handle no-op concat but failed (unless the
caller was using same pointer for src and dst).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_pack.c

index 0a57e39..14fcd38 100644 (file)
@@ -241,8 +241,12 @@ lp_build_concat_n(struct gallivm_state *gallivm,
    assert(num_srcs >= num_dsts);
    assert((num_srcs % size) == 0);
 
-   if (num_srcs == num_dsts)
+   if (num_srcs == num_dsts) {
+      for (i = 0; i < num_dsts; ++i) {
+         dst[i] = src[i];
+      }
       return 1;
+   }
 
    for (i = 0; i < num_dsts; ++i) {
       dst[i] = lp_build_concat(gallivm, &src[i * size], src_type, size);