Fix some functions leaking doubles in INTONLY

This commit is contained in:
GenericHeroGuy authored and Alug committed 2025-01-06 17:12:29 +01:00
1 parent 9c105db8da
commit a8743d50b8
2 files changed
+8

No files matched your search

+4
View File
@@ -470,7 +470,11 @@ LJLIB_CF(collectgarbage)
"\4stop\7restart\7collect\5count\1\377\4step\10setpause\12setstepmul\1\377\11isrunning");
int32_t data = lj_lib_optint(L, 2, 0);
if (opt == LUA_GCCOUNT) {
#if LJ_INTONLY
setintV(L->top, G(L)->gc.total/1024);
#else
setnumV(L->top, (lua_Number)G(L)->gc.total/1024.0);
#endif
} else {
int res = lua_gc(L, opt, data);
if (opt == LUA_GCSTEP || opt == LUA_GCISRUNNING)
+4
View File
@@ -72,7 +72,11 @@ LJLIB_CF(table_maxn)
lua_Number n = numberVnum(&node[i].key);
if (n > m) m = n;
}
#if LJ_INTONLY
setintV(L->top-1, lj_num2int(m));
#else
setnumV(L->top-1, m);
#endif
return 1;
}