mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 14:25:44 +08:00
perhaps this works better
This commit is contained in:
parent
9216e4cb27
commit
98217437ec
@ -1374,7 +1374,8 @@ static int luauF_writeinteger(lua_State* L, StkId res, TValue* arg0, int nresult
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
unsigned value;
|
unsigned value;
|
||||||
luai_num2unsigned(value, nvalue(args + 1));
|
double incoming = nvalue(args + 1);
|
||||||
|
luai_num2unsigned(value, incoming);
|
||||||
|
|
||||||
T val = T(value);
|
T val = T(value);
|
||||||
memcpy((char*)bufvalue(arg0)->data + offset, &val, sizeof(T));
|
memcpy((char*)bufvalue(arg0)->data + offset, &val, sizeof(T));
|
||||||
|
@ -53,9 +53,8 @@ LUAU_FASTMATH_END
|
|||||||
#if defined(_MSC_VER) && defined(_M_IX86)
|
#if defined(_MSC_VER) && defined(_M_IX86)
|
||||||
#define luai_num2unsigned(i, n) \
|
#define luai_num2unsigned(i, n) \
|
||||||
{ \
|
{ \
|
||||||
double v = (n); \
|
|
||||||
__int64 l; \
|
__int64 l; \
|
||||||
__asm { __asm fld v __asm fistp l} \
|
__asm { __asm fld n __asm fistp l} \
|
||||||
; \
|
; \
|
||||||
i = (unsigned int)l; \
|
i = (unsigned int)l; \
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user