Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2016-08-04 02:50:11 +0300
committerZoltan Varga <vargaz@gmail.com>2016-08-04 02:50:34 +0300
commit0cb79a3854d5109f4637167ffa9493d86fdcb07c (patch)
treec8ff44d98b469e36c7e8473348de748780af842d
parent7e087da798a029312db1f987edfdc212f08a4422 (diff)
[arm64] Assert that the displacement is not out of range int he b/bl macros, instead of in arm_get_disp (), so the assert location is more meaningful.mono-4.6.0.127
-rw-r--r--mono/arch/arm64/arm64-codegen.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/mono/arch/arm64/arm64-codegen.h b/mono/arch/arm64/arm64-codegen.h
index 6ca4da6d881..2d8c4c5a915 100644
--- a/mono/arch/arm64/arm64-codegen.h
+++ b/mono/arch/arm64/arm64-codegen.h
@@ -179,9 +179,9 @@ arm_get_disp (void *p, void *target)
}
// 0b00101 == 0x5
-#define arm_b(p, target) arm_emit (p, (0x0 << 31) | (0x5 << 26) | ((arm_get_disp ((p), (target)) << 0)))
+#define arm_b(p, target) do { if ((target)) g_assert (arm_is_bl_disp ((p), (target))); arm_emit (p, (0x0 << 31) | (0x5 << 26) | ((arm_get_disp ((p), (target)) << 0))); } while (0)
-#define arm_bl(p, target) arm_emit (p, (0x1 << 31) | (0x5 << 26) | ((arm_get_disp ((p), (target)) << 0)))
+#define arm_bl(p, target) do { if ((target)) g_assert (arm_is_bl_disp ((p), (target))); arm_emit (p, (0x1 << 31) | (0x5 << 26) | ((arm_get_disp ((p), (target)) << 0))); } while (0)
/* Conditional branch */