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 253384f20975bcf57a49234f10b3bc12783ca649..f43a774c9e54d2132f8321630912ed4eb28d4cf2 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 |