[macruby-changes] [5278] MacRuby/trunk/compiler.cpp
source_changes at macosforge.org
source_changes at macosforge.org
Mon Mar 14 19:03:16 PDT 2011
Revision: 5278
http://trac.macosforge.org/projects/ruby/changeset/5278
Author: lsansonetti at apple.com
Date: 2011-03-14 19:03:16 -0700 (Mon, 14 Mar 2011)
Log Message:
-----------
fix a bug where converting a NULL pointer as an opaque type value to Ruby would not give nil (as in RubyCocoa)
Modified Paths:
--------------
MacRuby/trunk/compiler.cpp
Modified: MacRuby/trunk/compiler.cpp
===================================================================
--- MacRuby/trunk/compiler.cpp 2011-03-14 18:50:42 UTC (rev 5277)
+++ MacRuby/trunk/compiler.cpp 2011-03-15 02:03:16 UTC (rev 5278)
@@ -5749,6 +5749,9 @@
VALUE
rb_vm_new_opaque(VALUE klass, void *val)
{
+ if (val == NULL) {
+ return Qnil;
+ }
return Data_Wrap_Struct(klass, NULL, NULL, val);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110314/e1fd01fc/attachment.html>
More information about the macruby-changes
mailing list