From 606b66db7dd142884acfdab7a40a29938ea729f1 Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 18 Dec 2012 04:30:44 +0000 Subject: * vm.c (rb_vm_make_jump_tag_but_local_jump): take care of the case TAG_JUMP() with TAG_FATAL (ex. rb_fatal()). * test/ruby/test_fiber.rb (test_fatal_in_fiber): add a test for above. * ext/-test-/fatal/extconf.rb, ext/-test-/fatal/rb_fatal.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/-test-/fatal/extconf.rb | 1 + ext/-test-/fatal/rb_fatal.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 ext/-test-/fatal/extconf.rb create mode 100644 ext/-test-/fatal/rb_fatal.c (limited to 'ext/-test-/fatal') diff --git a/ext/-test-/fatal/extconf.rb b/ext/-test-/fatal/extconf.rb new file mode 100644 index 0000000000..e0cfeb2095 --- /dev/null +++ b/ext/-test-/fatal/extconf.rb @@ -0,0 +1 @@ +create_makefile("-test-/fatal/rb_fatal") diff --git a/ext/-test-/fatal/rb_fatal.c b/ext/-test-/fatal/rb_fatal.c new file mode 100644 index 0000000000..71aef4658a --- /dev/null +++ b/ext/-test-/fatal/rb_fatal.c @@ -0,0 +1,19 @@ +#include + +static VALUE +ruby_fatal(VALUE obj, VALUE msg) +{ + const char *cmsg = NULL; + + (void)obj; + + cmsg = RSTRING_PTR(msg); + rb_fatal("%s", cmsg); + return 0; /* never reached */ +} + +void +Init_rb_fatal(void) +{ + rb_define_method(rb_mKernel, "rb_fatal", ruby_fatal, 1); +} -- cgit v1.2.1