guint8 *code, *start;
int this_pos = 3;
- if (!m->signature->ret->byref && MONO_TYPE_ISSTRUCT (m->signature->ret))
+ if (!mono_method_signature (m)->ret->byref && MONO_TYPE_ISSTRUCT (mono_method_signature (m)->ret))
this_pos = 4;
start = code = g_malloc (20);
/* Sanity check: instruction must be 'blrl' */
g_assert(*code == 0x4e800021);
-
+
+ /* the thunk-less direct call sequence: lis/ori/mtlr/blrl */
+ if ((code [-1] >> 26) == 31 && (code [-2] >> 26) == 24 && (code [-3] >> 26) == 15) {
+ ppc_patch ((char*)code, addr);
+ return addr;
+ }
+
/* OK, we're now at the 'blrl' instruction. Now walk backwards
till we get to a 'mtlr rA' */
for(; --code;) {