refactor out longjmp() to a function

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-07-25 14:54:17 +09:00
parent 8a298605e6
commit 63e5a3cfb1
4 changed files with 17 additions and 9 deletions
+7 -5
View File
@@ -2842,13 +2842,15 @@ codegen_start(mrb_state *mrb, parser_state *p)
if (p->filename) {
scope->filename = p->filename;
}
if (setjmp(scope->jmp) != 0) {
if (setjmp(scope->jmp) == 0) {
// prepare irep
codegen(scope, p->tree, NOVAL);
mrb_pool_close(scope->mpool);
return 0;
}
else {
return -1;
}
// prepare irep
codegen(scope, p->tree, NOVAL);
mrb_pool_close(scope->mpool);
return 0;
}
int