Revision
2916
Author
lsansonetti@apple.com
Date
2009-10-28 21:02:33 -0700 (Wed, 28 Oct 2009)

Log Message

fixed Pointer to work with ^v (void *) type

Modified Paths

Diff

Modified: MacRuby/trunk/bridgesupport.cpp (2915 => 2916)


--- MacRuby/trunk/bridgesupport.cpp	2009-10-29 02:16:12 UTC (rev 2915)
+++ MacRuby/trunk/bridgesupport.cpp	2009-10-29 04:02:33 UTC (rev 2916)
@@ -572,6 +572,12 @@
 VALUE
 rb_pointer_new(const char *type_str, void *val)
 {
+    // LLVM doesn't allow to get a pointer to Type::VoidTy, and for convenience
+    // reasons we map a pointer to void as a pointer to unsigned char.
+    if (*type_str == 'v') {
+	type_str = "C";
+    }
+
     rb_vm_pointer_t *ptr = (rb_vm_pointer_t *)xmalloc(sizeof(rb_vm_pointer_t));
     GC_WB(&ptr->type, rb_str_new2(type_str));