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

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: Clarify comments. Fix unaligned_data_irt.nexe, it had a hard-coded BKPT #0x7777. 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..966a17a5897aabe2d9b3dc6ada1f264b6f766b23 100644
--- a/src/trusted/validator_arm/baseline_classes.cc
+++ b/src/trusted/validator_arm/baseline_classes.cc
@@ -90,13 +90,18 @@ 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) == kLiteralPoolHead) ||
+ (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;
+ return i.Bits(31, 0) == kLiteralPoolHead;
}
// BranchToRegister

Powered by Google App Engine
This is Rietveld 408576698