summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-07-27 05:57:22 +0900
committerYukihiro Matsumoto <[email protected]>2012-07-27 05:57:22 +0900
commit92d37403f162c6876e60247114bc982d00d14aa2 (patch)
treede07ffc92ff02f5208b52f904aaa5b18b2711eb8 /src
parent344946233c7070d22f0b654a191ad20b0f92a1a0 (diff)
downloadmruby-92d37403f162c6876e60247114bc982d00d14aa2.tar.gz
mruby-92d37403f162c6876e60247114bc982d00d14aa2.zip
temporary protection not to access out of stack
Diffstat (limited to 'src')
-rw-r--r--src/gc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gc.c b/src/gc.c
index 819fb94c6..c0d4e1599 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -563,6 +563,7 @@ root_scan_phase(mrb_state *mrb)
/* mark stack */
e = mrb->stack - mrb->stbase;
if (mrb->ci) e += mrb->ci->nregs;
+ if (mrb->stbase + e > mrb->stend) e = mrb->stend - mrb->stbase;
for (i=0; i<e; i++) {
mrb_gc_mark_value(mrb, mrb->stbase[i]);
}