summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-bin-mruby/mrbgem.rake6
-rw-r--r--mrbgems/mruby-bin-mruby/tools/mruby/mruby.c12
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c2
-rw-r--r--mrbgems/mruby-compiler/mrbgem.rake4
-rw-r--r--mrbgems/mruby-error/mrbgem.rake2
5 files changed, 13 insertions, 13 deletions
diff --git a/mrbgems/mruby-bin-mruby/mrbgem.rake b/mrbgems/mruby-bin-mruby/mrbgem.rake
index ba7fad1fa..243b413eb 100644
--- a/mrbgems/mruby-bin-mruby/mrbgem.rake
+++ b/mrbgems/mruby-bin-mruby/mrbgem.rake
@@ -4,4 +4,10 @@ MRuby::Gem::Specification.new('mruby-bin-mruby') do |spec|
spec.summary = 'mruby command'
spec.bins = %w(mruby)
spec.add_dependency('mruby-compiler', :core => 'mruby-compiler')
+ spec.add_dependency('mruby-error', :core => 'mruby-error')
+
+ if build.cxx_exception_enabled?
+ @objs << build.compile_as_cxx("#{spec.dir}/tools/mruby/mruby.c", "#{spec.build_dir}/tools/mruby/mruby.cxx")
+ @objs.delete_if { |v| v == objfile("#{spec.build_dir}/tools/mruby/mruby") }
+ end
end
diff --git a/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c b/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
index d10535140..d0e5dc8dc 100644
--- a/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
+++ b/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
@@ -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;
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index 37f8201ec..c53abde7f 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -1814,6 +1814,8 @@ codegen(codegen_scope *s, node *tree, int val)
for (i=0; i<nargs; i++) {
genop(s, MKOP_AB(OP_MOVE, cursp()+i+1, base+i+1));
}
+ push_n(nargs+1);
+ pop_n(nargs+1);
callargs = nargs;
}
else {
diff --git a/mrbgems/mruby-compiler/mrbgem.rake b/mrbgems/mruby-compiler/mrbgem.rake
index 3a22762fa..3bf6d6ae3 100644
--- a/mrbgems/mruby-compiler/mrbgem.rake
+++ b/mrbgems/mruby-compiler/mrbgem.rake
@@ -8,11 +8,11 @@ MRuby::Gem::Specification.new 'mruby-compiler' do |spec|
lex_def = "#{current_dir}/core/lex.def"
core_objs = Dir.glob("#{current_dir}/core/*.c").map { |f|
- next nil if build.cxx_abi_enabled? and f =~ /(codegen).c$/
+ next nil if build.cxx_exception_enabled? and f =~ /(codegen).c$/
objfile(f.pathmap("#{current_build_dir}/core/%n"))
}.compact
- if build.cxx_abi_enabled?
+ if build.cxx_exception_enabled?
core_objs <<
build.compile_as_cxx("#{current_build_dir}/core/y.tab.c", "#{current_build_dir}/core/y.tab.cxx",
objfile("#{current_build_dir}/y.tab"), ["#{current_dir}/core"]) <<
diff --git a/mrbgems/mruby-error/mrbgem.rake b/mrbgems/mruby-error/mrbgem.rake
index b8281b17e..30a4259a8 100644
--- a/mrbgems/mruby-error/mrbgem.rake
+++ b/mrbgems/mruby-error/mrbgem.rake
@@ -3,7 +3,7 @@ MRuby::Gem::Specification.new('mruby-error') do |spec|
spec.author = 'mruby developers'
spec.summary = 'extensional error handling'
- if build.cxx_abi_enabled?
+ if build.cxx_exception_enabled?
@objs << build.compile_as_cxx("#{spec.dir}/src/exception.c", "#{spec.build_dir}/src/exception.cxx")
@objs.delete_if { |v| v == objfile("#{spec.build_dir}/src/exception") }
end