Update VM/src/lbuiltins.cpp

This commit is contained in:
Arseny Kapoulkine 2023-10-20 18:13:23 -07:00 committed by GitHub
parent f840c52f3d
commit d3ea567395
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1326,7 +1326,8 @@ static int luauF_byteswap(lua_State* L, StkId res, TValue* arg0, int nresults, S
double a1 = nvalue(arg0);
unsigned n;
luai_num2unsigned(n, a1);
n = (n << 24) | ((n << 8) & 0xff0000) | (n >> 8 & 0xff00) | n >> 24;
n = (n << 24) | ((n << 8) & 0xff0000) | ((n >> 8) & 0xff00) | (n >> 24);
setnvalue(res, double(n));
return 1;