diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-04-29 10:36:30 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-04-29 10:36:30 +0900 |
| commit | 29f6cdcd4de8bacdfb33c9d741e9c3a8204f5b2b (patch) | |
| tree | c724624eb93bbf5951b1c68926de1c12ffcc337a | |
| parent | 57e6a783bc0eed2a11bd64c00cbbca1d11fce04a (diff) | |
| download | mruby-29f6cdcd4de8bacdfb33c9d741e9c3a8204f5b2b.tar.gz mruby-29f6cdcd4de8bacdfb33c9d741e9c3a8204f5b2b.zip | |
stack may be uncleared
| -rw-r--r-- | src/gc.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -441,7 +441,16 @@ mark_context_stack(mrb_state *mrb, struct mrb_context *c) if (c->ci) e += c->ci->nregs; if (c->stbase + e > c->stend) e = c->stend - c->stbase; for (i=0; i<e; i++) { - mrb_gc_mark_value(mrb, c->stbase[i]); + mrb_value v = c->stbase[i]; + + if (!mrb_immediate_p(v)) { + if (mrb_basic_ptr(v)->tt == MRB_TT_FREE) { + c->stbase[i] = mrb_nil_value(); + } + else { + mrb_gc_mark(mrb, mrb_basic_ptr(v)); + } + } } } |
