Index: src/PNaClTranslator.cpp |
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp |
index ac9698e598e97d757d378a2e47eeb4fb9e13bee0..5f87897c8f927f548fb1cb0cc62fd4c9bd0a2d63 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,15 @@ void FunctionParser::ProcessRecord() { |
appendErrorInstruction(Elt->getType()); |
return; |
} |
+ if (Ice::typeElementType(VecType) != Elt->getType()) { |
+ std::string Buffer; |
+ raw_string_ostream StrBuf(Buffer); |
+ StrBuf << "Element type " << Ice::typeString(Elt->getType()) |
Jim Stichnoth
2015/09/21 21:39:54
May want to use the string "insertelement" in the
Karl
2015/09/21 22:32:46
Done.
|
+ << " 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; |