[macruby-changes] [5197] MacRuby/trunk/dln.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 27 19:55:45 PST 2011


Revision: 5197
          http://trac.macosforge.org/projects/ruby/changeset/5197
Author:   lsansonetti at apple.com
Date:     2011-01-27 19:55:45 -0800 (Thu, 27 Jan 2011)
Log Message:
-----------
fix a problem in #load: instead of crashing if we cannot locate the entry point of a .rbo file, raise an exception with a message explaining the most common problem cause instead

Modified Paths:
--------------
    MacRuby/trunk/dln.c

Modified: MacRuby/trunk/dln.c
===================================================================
--- MacRuby/trunk/dln.c	2011-01-28 03:29:12 UTC (rev 5196)
+++ MacRuby/trunk/dln.c	2011-01-28 03:55:45 UTC (rev 5197)
@@ -123,7 +123,9 @@
 	    (*init_fct)();
 	}
 	else {
-	    assert(__mrep__ != NULL);
+	    if (__mrep__ == NULL) {
+		rb_raise(rb_eLoadError, "Can't load %s: entry point function not located (this can happen when you load twice the same .rbo file with a different case on a case-insensitive filesystem)", file);
+	    }
 	    ((IMP)__mrep__)((id)rb_vm_top_self(), 0);
 	}
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110127/4185b8fa/attachment.html>


More information about the macruby-changes mailing list