[macruby-changes] [2399] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Aug 27 21:46:52 PDT 2009


Revision: 2399
          http://trac.macosforge.org/projects/ruby/changeset/2399
Author:   lsansonetti at apple.com
Date:     2009-08-27 21:46:49 -0700 (Thu, 27 Aug 2009)
Log Message:
-----------
make sure miniruby doesn't crash loading a C extension bundle

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

Modified: MacRuby/trunk/dln.c
===================================================================
--- MacRuby/trunk/dln.c	2009-08-27 19:53:27 UTC (rev 2398)
+++ MacRuby/trunk/dln.c	2009-08-28 04:46:49 UTC (rev 2399)
@@ -65,9 +65,16 @@
     return (char*)dlerror();
 }
 
+extern bool ruby_is_miniruby;
+
 void*
 dln_load(const char *file)
 {
+    if (ruby_is_miniruby) {
+	rb_raise(rb_eLoadError,
+		"miniruby can't load C extension bundles due to technical problems");
+    }
+
     const char *error = 0;
 #define DLN_ERROR() (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error))
 

Modified: MacRuby/trunk/main.cpp
===================================================================
--- MacRuby/trunk/main.cpp	2009-08-27 19:53:27 UTC (rev 2398)
+++ MacRuby/trunk/main.cpp	2009-08-28 04:46:49 UTC (rev 2399)
@@ -18,6 +18,8 @@
     void rb_vm_init_compiler(void);
 }
 
+bool ruby_is_miniruby = false;
+
 int
 main(int argc, char **argv, char **envp)
 {
@@ -25,6 +27,8 @@
     setlocale(LC_CTYPE, "");
 #endif
 
+    ruby_is_miniruby = argc > 0 && strstr(argv[0], "miniruby") != NULL;
+
     try {
 	ruby_sysinit(&argc, &argv);
 	ruby_init();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090827/ea2e4ae3/attachment.html>


More information about the macruby-changes mailing list