Fix bug in new assertion

llvm-svn: 1279
diff --git a/llvm/lib/Bytecode/Reader/InstructionReader.cpp b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
index 6587ab2..8dc9b8d 100644
--- a/llvm/lib/Bytecode/Reader/InstructionReader.cpp
+++ b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
@@ -376,14 +376,17 @@
       delete Raw.VarArgs; 
       break;
     }
-    assert(LoadInst::getIndexedType(Raw.Ty, Idx) && 
-           "Bad indices for GEP or Load!");
-    if (Raw.Opcode == Instruction::Load)
+
+    if (Raw.Opcode == Instruction::Load) {
+      assert(MemAccessInst::getIndexedType(Raw.Ty, Idx) && 
+             "Bad indices for GEP or Load!");
       Res = new LoadInst(getValue(Raw.Ty, Raw.Arg1), Idx);
-    else if (Raw.Opcode == Instruction::GetElementPtr)
+    } else if (Raw.Opcode == Instruction::GetElementPtr)
       Res = new GetElementPtrInst(getValue(Raw.Ty, Raw.Arg1), Idx);
     else
       abort();
+    if (!MemAccessInst::getIndexedType(Raw.Ty, Idx))
+      cerr << Res;
     return false;
   }
   case Instruction::Store: {