Skip to content
Permalink
Browse files
Avoid using <mruby/throw.h> in mruby.c
  • Loading branch information
matz committed Mar 2, 2017
1 parent eca35df commit 9b176a1ca8249de38a056ad075e10277300c03a2
Showing 1 changed file with 2 additions and 10 deletions.
@@ -6,7 +6,6 @@
#include <mruby/compile.h>
#include <mruby/dump.h>
#include <mruby/variable.h>
#include <mruby/throw.h>

#ifdef MRB_DISABLE_STDIO
static void
@@ -177,8 +176,6 @@ main(int argc, char **argv)
mrbc_context *c;
mrb_value v;
mrb_sym zero_sym;
struct mrb_jmpbuf c_jmp;
int ai;

if (mrb == NULL) {
fputs("Invalid mrb_state, exiting mruby\n", stderr);
@@ -191,10 +188,8 @@ main(int argc, char **argv)
usage(argv[0]);
return n;
}

ai = mrb_gc_arena_save(mrb);
MRB_TRY(&c_jmp) {
mrb->jmp = &c_jmp;
else {
int ai = mrb_gc_arena_save(mrb);
ARGV = mrb_ary_new_capa(mrb, args.argc);
for (i = 0; i < args.argc; i++) {
char* utf8 = mrb_utf8_from_locale(args.argv[i], -1);
@@ -250,9 +245,6 @@ main(int argc, char **argv)
printf("Syntax OK\n");
}
}
MRB_CATCH(&c_jmp) { /* error */
}
MRB_END_EXC(&c_jmp);
cleanup(mrb, &args);

return n == 0 ? EXIT_SUCCESS : EXIT_FAILURE;

0 comments on commit 9b176a1

Please sign in to comment.