FFI: Fix stack-adjustment for __thiscall callbacks.

This commit is contained in:
Mike Pall 2012-11-07 18:04:58 +01:00
parent e941caafcf
commit 8a11869d49

View File

@ -481,12 +481,9 @@ static void callback_conv_args(CTState *cts, lua_State *L)
} }
L->top = o; L->top = o;
#if LJ_TARGET_X86 #if LJ_TARGET_X86
/* Store stack adjustment for returns from fastcall/stdcall callbacks. */ /* Store stack adjustment for returns from non-cdecl callbacks. */
switch (ctype_cconv(ct->info)) { if (ctype_cconv(ct->info) != CTCC_CDECL)
case CTCC_FASTCALL: case CTCC_STDCALL:
(L->base-2)->u32.hi |= (nsp << (16+2)); (L->base-2)->u32.hi |= (nsp << (16+2));
break;
}
#endif #endif
} }