protect returning irep (in proc) from GC

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-11-09 04:08:24 +09:00
parent de790bdc27
commit 7aabc657f1
2 changed files with 9 additions and 2 deletions
+1
View File
@@ -2906,6 +2906,7 @@ mrb_generate_code(mrb_state *mrb, parser_state *p)
// prepare irep
codegen(scope, p->tree, NOVAL);
proc = mrb_proc_new(mrb, scope->irep);
mrb_irep_decref(mrb, scope->irep);
mrb_pool_close(scope->mpool);
return proc;
}