Author: zoltan
Date: 2005-03-11 11:15:49 -0500 (Fri, 11 Mar 2005)
New Revision: 41705
Modified:
trunk/mono/mono/mini/ChangeLog
trunk/mono/mono/mini/mini-amd64.c
Log:
2005-03-11 Zoltan Varga <[EMAIL PROTECTED]>
* mini-amd64.c (mono_arch_get_vcall_slot_addr): Reorder cases to be
extra safe.
Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog 2005-03-11 16:05:07 UTC (rev 41704)
+++ trunk/mono/mono/mini/ChangeLog 2005-03-11 16:15:49 UTC (rev 41705)
@@ -1,5 +1,8 @@
2005-03-11 Zoltan Varga <[EMAIL PROTECTED]>
+ * mini-amd64.c (mono_arch_get_vcall_slot_addr): Reorder cases to be
+ extra safe.
+
* mini-amd64.c (mono_arch_get_vcall_slot_addr): Fix ordering of cases.
* aot.c (mono_aot_load_method): Get rid of bogus make_writable call.
Modified: trunk/mono/mono/mini/mini-amd64.c
===================================================================
--- trunk/mono/mono/mini/mini-amd64.c 2005-03-11 16:05:07 UTC (rev 41704)
+++ trunk/mono/mono/mini/mini-amd64.c 2005-03-11 16:15:49 UTC (rev 41705)
@@ -5676,16 +5676,10 @@
/*
* A given byte sequence can match more than case here, so we have to be
- * really careful about the ordering of the cases.
+ * really careful about the ordering of the cases. Longer sequences
+ * come first.
*/
- if (code [2] == 0xe8)
- /* call <ADDR> */
- return NULL;
- else if (IS_REX (code [4]) && (code [5] == 0xff) && (amd64_modrm_reg
(code [6]) == 0x2) && (amd64_modrm_mod (code [6]) == 0x3)) {
- /* call *%reg */
- return NULL;
- }
- else if ((code [0] == 0x41) && (code [1] == 0xff) && (code [2] ==
0x15)) {
+ if ((code [0] == 0x41) && (code [1] == 0xff) && (code [2] == 0x15)) {
/* call OFFSET(%rip) */
return NULL;
}
@@ -5697,6 +5691,14 @@
disp = *(guint32*)(code + 3);
//printf ("B: [%%r%d+0x%x]\n", reg, disp);
}
+ else if (code [2] == 0xe8) {
+ /* call <ADDR> */
+ return NULL;
+ }
+ else if (IS_REX (code [4]) && (code [5] == 0xff) && (amd64_modrm_reg
(code [6]) == 0x2) && (amd64_modrm_mod (code [6]) == 0x3)) {
+ /* call *%reg */
+ return NULL;
+ }
else if ((code [4] == 0xff) && (amd64_modrm_reg (code [5]) == 0x2) &&
(amd64_modrm_mod (code [5]) == 0x1)) {
/* call *[reg+disp8] */
if (IS_REX (code [3]))
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches