From: Ian Romanick Date: Wed, 24 Mar 2010 22:27:50 +0000 (-0700) Subject: Fix typo in swizzle processing loop X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4d184a1d02edef1720bb8093a91596831f7c017d;p=mesa.git Fix typo in swizzle processing loop One of the accesses to str in the loop used str[0] instead of str[i]. Reported-by: Kenneth Graunke --- diff --git a/hir_field_selection.cpp b/hir_field_selection.cpp index 9928b7b0bfa..aa53120dbdb 100644 --- a/hir_field_selection.cpp +++ b/hir_field_selection.cpp @@ -93,7 +93,7 @@ generate_swizzle(const char *str, ir_dereference *deref, if ((str[i] < 'a') || (str[i] > 'z')) return false; - swiz_idx[i] = idx_map[str[0] - 'a'] - base; + swiz_idx[i] = idx_map[str[i] - 'a'] - base; if ((swiz_idx[i] < 0) || (swiz_idx[i] >= (int) vector_length)) return false; }