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

Unified Diff: src/trusted/validator_arm/baseline_classes.cc

Issue 11194045: Change BKPT and UDF encodings on ARM. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 8 years, 2 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
Index: src/trusted/validator_arm/baseline_classes.cc
diff --git a/src/trusted/validator_arm/baseline_classes.cc b/src/trusted/validator_arm/baseline_classes.cc
index 253013932af31c3026c147ef2350d841d6041ca0..001ad76d1dd66acb525764b1d65b88b3c63732d9 100644
--- a/src/trusted/validator_arm/baseline_classes.cc
+++ b/src/trusted/validator_arm/baseline_classes.cc
@@ -90,10 +90,15 @@ int32_t BranchImmediate24::branch_target_offset(Instruction i) const {
// BreakPointAndConstantPoolHead
SafetyLevel BreakPointAndConstantPoolHead::safety(const Instruction i) const {
- return i.GetCondition() == Instruction::AL
- ? MAY_BE_SAFE
- : UNPREDICTABLE;
+ if (i.GetCondition() != Instruction::AL)
+ return UNPREDICTABLE;
+ // Restrict BKPT's encoding to values we've chosen as safe.
+ if ((i.Bits(31, 0) == kLiteralPoolHeadInstruction) ||
+ (i.Bits(31, 0) == kBreakpoint))
+ return MAY_BE_SAFE;
+ return FORBIDDEN_OPERANDS;
}
+
bool BreakPointAndConstantPoolHead::
is_literal_pool_head(const Instruction i) const {
return i.Bits(31, 0) == kLiteralPoolHeadInstruction;

Powered by Google App Engine
This is Rietveld 408576698