aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2009-12-29 02:34:15 +0100
committerMike Pall <mike>2009-12-29 02:34:15 +0100
commit241e8db3f10570411d92d0905eed32fd3c9a9631 (patch)
tree27515b964c6a3b670df0262ac4aac53d1c78cd87 /src
parent52f310bd3e214f876b4681d7ea3e5d6472feba5c (diff)
downloadluajit-241e8db3f10570411d92d0905eed32fd3c9a9631.tar.gz
luajit-241e8db3f10570411d92d0905eed32fd3c9a9631.tar.bz2
luajit-241e8db3f10570411d92d0905eed32fd3c9a9631.zip
Fix bad stack setup in collectgarbage().
Diffstat (limited to 'src')
-rw-r--r--src/lib_base.c7
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