Add an assert to catch invalid VECTOR_SHUFFLE mask indices.

llvm-svn: 54329
This commit is contained in:
Dan Gohman 2008-08-04 23:09:15 +00:00
parent be9b33bf0f
commit 8ef79ebd5f
1 changed files with 1 additions and 0 deletions

View File

@ -3665,6 +3665,7 @@ LowerVECTOR_SHUFFLE_4wide(SDValue V1, SDValue V2,
Locs[i] = std::make_pair(-1, -1);
} else {
unsigned Val = cast<ConstantSDNode>(Elt)->getValue();
assert(Val < 8 && "Invalid VECTOR_SHUFFLE index!");
if (Val < 4) {
Locs[i] = std::make_pair(0, NumLo);
Mask1[NumLo] = Elt;