Revision
5246
Author
lsansonetti@apple.com
Date
2011-02-25 17:08:28 -0800 (Fri, 25 Feb 2011)

Log Message

fix a bug where we would crash when protecting an internal call during an exception raise

Modified Paths

Diff

Modified: MacRuby/trunk/error.c (5245 => 5246)


--- MacRuby/trunk/error.c	2011-02-25 22:24:32 UTC (rev 5245)
+++ MacRuby/trunk/error.c	2011-02-26 01:08:28 UTC (rev 5246)
@@ -828,7 +828,7 @@
 	    desc = "false";
 	    break;
 	  default:
-	    d = rb_protect(safe_inspect, obj, 0);
+	    d = rb_protect(safe_inspect, obj, NULL);
 	    if (NIL_P(d) || RSTRING_LEN(d) > 65) {
 		d = rb_any_to_s(obj);
 	    }

Modified: MacRuby/trunk/eval.c (5245 => 5246)


--- MacRuby/trunk/eval.c	2011-02-25 22:24:32 UTC (rev 5245)
+++ MacRuby/trunk/eval.c	2011-02-26 01:08:28 UTC (rev 5246)
@@ -487,7 +487,10 @@
 static VALUE
 protect_rescue(VALUE obj, VALUE exc)
 {
-    *(int *)obj = 1;
+   int *state = (int *)obj;
+   if (state != NULL) {
+	*state = 1;
+   }
     GC_RETAIN(exc);
     protect_exc = exc;
     return Qnil;