diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-09-05 21:13:16 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-09-05 21:13:16 +0900 |
| commit | cbfa2b3588732f41669a532f5070cd87cf270319 (patch) | |
| tree | 50dd2837292d99300491d1b4eb471f845533d4d6 /src | |
| parent | f68f5f6b975207a02d11f7b9d6870ee1f5098f85 (diff) | |
| download | mruby-cbfa2b3588732f41669a532f5070cd87cf270319.tar.gz mruby-cbfa2b3588732f41669a532f5070cd87cf270319.zip | |
Avoid recursion from `mark_context()`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -582,6 +582,7 @@ mark_context(mrb_state *mrb, struct mrb_context *c) int i; mrb_callinfo *ci; + start: if (c->status == MRB_FIBER_TERMINATED) return; /* mark VM stack */ @@ -603,7 +604,8 @@ mark_context(mrb_state *mrb, struct mrb_context *c) /* mark fibers */ mrb_gc_mark(mrb, (struct RBasic*)c->fib); if (c->prev) { - mark_context(mrb, c->prev); + c = c->prev; + goto start; } } |
