Index: src/PNaClTranslator.cpp |
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp |
index ac9698e598e97d757d378a2e47eeb4fb9e13bee0..449332a3cbb6fe596457d6044b986b26426c8e9f 100644 |
--- a/src/PNaClTranslator.cpp |
+++ b/src/PNaClTranslator.cpp |
@@ -2037,7 +2037,11 @@ private: |
std::string Buffer; |
raw_string_ostream StrBuf(Buffer); |
StrBuf << "Value index " << Index << " not defined!"; |
- Fatal(StrBuf.str()); |
+ Error(StrBuf.str()); |
+ // Recover and return some value. |
+ if (!LocalOperands.empty()) |
+ return LocalOperands.front(); |
+ return Context->getGlobalConstantByID(0); |
} |
}; |
@@ -2288,6 +2292,16 @@ void FunctionParser::ProcessRecord() { |
appendErrorInstruction(Elt->getType()); |
return; |
} |
+ if (Ice::typeElementType(VecType) != Elt->getType()) { |
+ std::string Buffer; |
+ raw_string_ostream StrBuf(Buffer); |
+ StrBuf << "Insertelement: Element type " |
+ << Ice::typeString(Elt->getType()) << " doesn't match vector type " |
+ << Ice::typeString(VecType); |
+ Error(StrBuf.str()); |
+ appendErrorInstruction(Elt->getType()); |
+ return; |
+ } |
CurrentNode->appendInst(Ice::InstInsertElement::create( |
Func.get(), getNextInstVar(VecType), Vec, Elt, Index)); |
return; |