gallivm: Fix trivial out-of-bounds indirection in lp_build_cube_lookup(). 20/6220/1
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 26 Apr 2013 07:43:00 +0000 (08:43 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 26 Apr 2013 07:44:37 +0000 (08:44 +0100)
commit542c5b37034a9615924d8b3daf9e23cd11cc1a57
tree084e40fdadaa1503752d95e6c3fd5f88a8fa3527
parent0c1d87b0d7e2c9f1ae6e838a8fa7f074557e45f0
gallivm: Fix trivial out-of-bounds indirection in lp_build_cube_lookup().

Courtesy of clang:

  src/gallium/auxiliary/gallivm/lp_bld_sample.c:1483:10: warning: array index of '2' indexes past the end of an array (that contains 2 elements) [-Warray-bounds]
           tmp[2] = lp_build_swizzle_aos(coord_bld, ddx_ddy[1], swizzle02);
           ^   ~
  src/gallium/auxiliary/gallivm/lp_bld_sample.c:1430:10: note: array 'tmp' declared here
           LLVMValueRef ddx_ddy[2], tmp[2], rho_vec;
           ^
  src/gallium/auxiliary/gallivm/lp_bld_sample.c:1487:56: warning: array index of '2' indexes past the end of an array (that contains 2 elements) [-Warray-bounds]
              rho_vec = lp_build_add(coord_bld, rho_vec, tmp[2]);
                                                       ^   ~
  src/gallium/auxiliary/gallivm/lp_bld_sample.c:1430:10: note: array 'tmp' declared here
           LLVMValueRef ddx_ddy[2], tmp[2], rho_vec;
           ^
  src/gallium/auxiliary/gallivm/lp_bld_sample.c:1491:56: warning: array index of '2' indexes past the end of an array (that contains 2 elements) [-Warray-bounds]
              rho_vec = lp_build_max(coord_bld, rho_vec, tmp[2]);
                                                       ^   ~
  src/gallium/auxiliary/gallivm/lp_bld_sample.c:1430:10: note: array 'tmp' declared here
           LLVMValueRef ddx_ddy[2], tmp[2], rho_vec;
           ^
src/gallium/auxiliary/gallivm/lp_bld_sample.c