[macruby-changes] [5192] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 27 18:16:11 PST 2011


Revision: 5192
          http://trac.macosforge.org/projects/ruby/changeset/5192
Author:   lsansonetti at apple.com
Date:     2011-01-27 18:16:11 -0800 (Thu, 27 Jan 2011)
Log Message:
-----------
fix a bug in #at_exit when the process would abort if a block raised an exception

Modified Paths:
--------------
    MacRuby/trunk/eval_jump.c
    MacRuby/trunk/string.c
    MacRuby/trunk/vm.cpp
    MacRuby/trunk/vm.h

Modified: MacRuby/trunk/eval_jump.c
===================================================================
--- MacRuby/trunk/eval_jump.c	2011-01-26 00:43:25 UTC (rev 5191)
+++ MacRuby/trunk/eval_jump.c	2011-01-28 02:16:11 UTC (rev 5192)
@@ -55,9 +55,9 @@
 }
 
 static VALUE
-rb_end_proc_call_catch(VALUE data)
+rb_end_proc_call_catch(VALUE data, VALUE exc)
 {
-    rb_vm_print_current_exception();
+    rb_vm_print_exception(exc);
     return Qnil;
 }
 

Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c	2011-01-26 00:43:25 UTC (rev 5191)
+++ MacRuby/trunk/string.c	2011-01-28 02:16:11 UTC (rev 5192)
@@ -425,11 +425,11 @@
     if (cache != NULL) {
 	cache->cached_length = length;
     }
-
     return length;
 }
 
-static long str_length(rb_str_t *self)
+static long
+str_length(rb_str_t *self)
 {
     return str_length_with_cache(self, NULL);
 }

Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp	2011-01-26 00:43:25 UTC (rev 5191)
+++ MacRuby/trunk/vm.cpp	2011-01-28 02:16:11 UTC (rev 5192)
@@ -3778,6 +3778,13 @@
 
 extern "C"
 void
+rb_vm_print_exception(VALUE exc)
+{
+    printf("%s", rb_str_cstr(rb_format_exception_message(exc)));
+}
+
+extern "C"
+void
 rb_vm_print_current_exception(void)
 {
     VALUE exc = GET_VM()->current_exception();
@@ -3785,7 +3792,7 @@
 	printf("uncaught Objective-C/C++ exception...\n");
 	std::terminate();
     }
-    printf("%s", rb_str_cstr(rb_format_exception_message(exc)));
+    rb_vm_print_exception(exc);
 }
 
 extern "C"

Modified: MacRuby/trunk/vm.h
===================================================================
--- MacRuby/trunk/vm.h	2011-01-26 00:43:25 UTC (rev 5191)
+++ MacRuby/trunk/vm.h	2011-01-28 02:16:11 UTC (rev 5192)
@@ -475,6 +475,7 @@
 VALUE rb_vm_current_exception(void);
 void rb_vm_set_current_exception(VALUE exception);
 VALUE rb_vm_backtrace(int skip);
+void rb_vm_print_exception(VALUE exc);
 void rb_vm_print_current_exception(void);
 
 #define TEST_THREAD_CANCEL() (pthread_testcancel())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110127/19792707/attachment.html>


More information about the macruby-changes mailing list