Skip to content

Commit 4da310b

Browse files
committedSep 5, 2019
Fix x86 Win32 port by disabling LUA_MSASMTRICK and adding explicit casts.
1 parent 64d9565 commit 4da310b

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed
 

‎ltable.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ const TValue *luaH_getint (Table *t, int key) {
451451
lua_Number nk = cast_num(key);
452452
Node *n = hashnum(t, nk);
453453
do { /* check whether `key' is somewhere in the chain */
454-
if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk))
454+
if (ttisnumber(gkey(n)) && luai_numeq((lua_Number)nvalue(gkey(n)), nk))
455455
return gval(n); /* that's it */
456456
else n = gnext(n);
457457
} while (n);

‎luaconf.h

+1
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@
555555
#undef LUA_NUMBER_DOUBLE
556556
#undef LUA_NUMBER
557557
#undef LUA_IEEE754TRICK
558+
#undef LUA_MSASMTRICK
558559
#undef LUAI_UACNUMBER
559560

560561
#undef lua_number2str

‎lvm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ void luaV_execute (lua_State *L) {
766766
)
767767
vmcase(OP_FORLOOP,
768768
lua_Number step = nvalue(ra+2);
769-
lua_Number idx = luai_numadd(L, nvalue(ra), step); /* increment index */
769+
lua_Number idx = luai_numadd(L, (lua_Number)nvalue(ra), step); /* increment index */
770770
lua_Number limit = nvalue(ra+1);
771771
if (luai_numlt(L, 0, step) ? luai_numle(L, idx, limit)
772772
: luai_numle(L, limit, idx)) {

0 commit comments

Comments
 (0)
Please sign in to comment.