Permalink
Browse files

fix a bug where converting a NULL pointer as an opaque type value to …

…Ruby would not give nil (as in RubyCocoa)

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5278 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent 3d910b4 commit dd2226768f4ea60762b783f450f8300ec27acbee @lrz lrz committed Mar 15, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 compiler.cpp
View
@@ -5749,6 +5749,9 @@ extern "C"
VALUE
rb_vm_new_opaque(VALUE klass, void *val)
{
+ if (val == NULL) {
+ return Qnil;
+ }
return Data_Wrap_Struct(klass, NULL, NULL, val);
}

0 comments on commit dd22267

Please sign in to comment.