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
This commit is contained in:
Ian Romanick
2010-03-24 15:27:50 -07:00
parent 9e97ffb754
commit 4d184a1d02
+1 -1
View File
@@ -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;
}