Reviewers: Rodolph Perfetta (ARM),

Description:
A64: Check that branch targets are reachable.

Assembling a branch that cannot reach its target is a security hole.
This patch prepares incoming changes that let the MacroAssembler handle branches
to distant targets.

Please review this at https://codereview.chromium.org/157683003/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/a64

Affected files (+6, -6 lines):
  M src/a64/assembler-a64-inl.h


Index: src/a64/assembler-a64-inl.h
diff --git a/src/a64/assembler-a64-inl.h b/src/a64/assembler-a64-inl.h
index 5839bef26886d46888a79c0fc1d3ffa24936a7f1..ebd3ec8b4d919b4e2212aefa5aa5fe919dd6ebc8 100644
--- a/src/a64/assembler-a64-inl.h
+++ b/src/a64/assembler-a64-inl.h
@@ -884,7 +884,7 @@ Instr Assembler::Cond(Condition cond) {


 Instr Assembler::ImmPCRelAddress(int imm21) {
-  ASSERT(is_int21(imm21));
+  CHECK(is_int21(imm21));
   Instr imm = static_cast<Instr>(truncate_to_int21(imm21));
   Instr immhi = (imm >> ImmPCRelLo_width) << ImmPCRelHi_offset;
   Instr immlo = imm << ImmPCRelLo_offset;
@@ -893,25 +893,25 @@ Instr Assembler::ImmPCRelAddress(int imm21) {


 Instr Assembler::ImmUncondBranch(int imm26) {
-  ASSERT(is_int26(imm26));
+  CHECK(is_int26(imm26));
   return truncate_to_int26(imm26) << ImmUncondBranch_offset;
 }


 Instr Assembler::ImmCondBranch(int imm19) {
-  ASSERT(is_int19(imm19));
+  CHECK(is_int19(imm19));
   return truncate_to_int19(imm19) << ImmCondBranch_offset;
 }


 Instr Assembler::ImmCmpBranch(int imm19) {
-  ASSERT(is_int19(imm19));
+  CHECK(is_int19(imm19));
   return truncate_to_int19(imm19) << ImmCmpBranch_offset;
 }


 Instr Assembler::ImmTestBranch(int imm14) {
-  ASSERT(is_int14(imm14));
+  CHECK(is_int14(imm14));
   return truncate_to_int14(imm14) << ImmTestBranch_offset;
 }

@@ -978,7 +978,7 @@ Instr Assembler::ImmRotate(unsigned immr, unsigned reg_size) {


 Instr Assembler::ImmLLiteral(int imm19) {
-  ASSERT(is_int19(imm19));
+  CHECK(is_int19(imm19));
   return truncate_to_int19(imm19) << ImmLLiteral_offset;
 }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to