diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib_base.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib_base.c b/src/lib_base.c index 3762879a..34282cfc 100644 --- a/src/lib_base.c +++ b/src/lib_base.c | |||
@@ -354,14 +354,15 @@ LJLIB_CF(collectgarbage) | |||
354 | "\4stop\7restart\7collect\5count\1\377\4step\10setpause\12setstepmul"); | 354 | "\4stop\7restart\7collect\5count\1\377\4step\10setpause\12setstepmul"); |
355 | int32_t data = lj_lib_optint(L, 2, 0); | 355 | int32_t data = lj_lib_optint(L, 2, 0); |
356 | if (opt == LUA_GCCOUNT) { | 356 | if (opt == LUA_GCCOUNT) { |
357 | setnumV(L->top-1, cast_num((int32_t)G(L)->gc.total)/1024.0); | 357 | setnumV(L->top, cast_num((int32_t)G(L)->gc.total)/1024.0); |
358 | } else { | 358 | } else { |
359 | int res = lua_gc(L, opt, data); | 359 | int res = lua_gc(L, opt, data); |
360 | if (opt == LUA_GCSTEP) | 360 | if (opt == LUA_GCSTEP) |
361 | setboolV(L->top-1, res); | 361 | setboolV(L->top, res); |
362 | else | 362 | else |
363 | setintV(L->top-1, res); | 363 | setintV(L->top, res); |
364 | } | 364 | } |
365 | L->top++; | ||
365 | return 1; | 366 | return 1; |
366 | } | 367 | } |
367 | 368 | ||