Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: src/PNaClTranslator.cpp

Issue 1363983002: Check that address is i32 for indirect calls. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests_lit/parse_errs/Inputs/indirect-call-on-float.tbc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index d7928659619a9fe6e8d6cf5f2f7395d9f9e73f57..1fb8afbc50f865591ca073a9ea49e27913ef692e 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -1598,7 +1598,7 @@ private:
std::string Buffer;
raw_string_ostream StrBuf(Buffer);
StrBuf << InstructionName << " address not " << PtrType
- << ". Found: " << *Op;
+ << ". Found: " << Op->getType();
Error(StrBuf.str());
return false;
}
@@ -2689,6 +2689,10 @@ void FunctionParser::ProcessRecord() {
}
} else {
ReturnType = Context->getSimpleTypeByID(Values[2]);
+ if (!isValidPointerType(Callee, "Call indirect")) {
+ if (ReturnType != Ice::IceType_void)
+ appendErrorInstruction(ReturnType);
Jim Stichnoth 2015/09/23 20:40:06 Should you return after this error? Or fall throu
Karl 2015/09/24 21:28:22 The code in general, should error recover if possi
+ }
}
// Check return type.
« no previous file with comments | « no previous file | tests_lit/parse_errs/Inputs/indirect-call-on-float.tbc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698