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

Unified Diff: src/trusted/validator_mips/validator.cc

Issue 11415031: [MIPS] Forbid $sp update at the end of the last bundle. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Presubmit errors have been fixed. Created 8 years, 1 month 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 | « src/trusted/validator_mips/validator.h ('k') | src/trusted/validator_mips/validator_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_mips/validator.cc
diff --git a/src/trusted/validator_mips/validator.cc b/src/trusted/validator_mips/validator.cc
index 1e4d71e651258106447f6e1013b11454983db0dd..0cd83fa610803709ac6ad3084796f6dbaf96ccb8 100644
--- a/src/trusted/validator_mips/validator.cc
+++ b/src/trusted/validator_mips/validator.cc
@@ -202,14 +202,15 @@ static PatternMatch CheckLoadStore(const SfiValidator &sfi,
ProblemSink *out) {
if (second.IsLoadStore()) {
Register base_addr_reg = second.BaseAddressRegister();
- if (!sfi.data_address_registers().ContainsAll(base_addr_reg)) {
+ if (!sfi.data_address_registers().
+ ContainsAll(RegisterList(base_addr_reg))) {
if (first.IsMask(base_addr_reg, kRegisterLoadStoreMask)) {
return PATTERN_SAFE;
}
out->ReportProblem(second.addr(), second.safety(),
kProblemUnsafeLoadStore);
return PATTERN_UNSAFE;
- }
+ }
}
return NO_MATCH;
}
@@ -355,6 +356,13 @@ bool SfiValidator::ValidateFallthrough(const CodeSegment &segment,
prev = inst;
}
+
+ // Validate the last instruction, paired with a nop.
+ const Instruction nop(nacl_mips_dec::kNop);
+ DecodedInstruction one_past_end(segment.EndAddr(), nop,
+ nacl_mips_dec::decode(nop, decode_state_));
+ complete_success &= ApplyPatterns(prev, one_past_end, critical, out);
+
return complete_success;
}
« no previous file with comments | « src/trusted/validator_mips/validator.h ('k') | src/trusted/validator_mips/validator_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698