Modified: MacRuby/trunk/objc.m (783 => 784)
--- MacRuby/trunk/objc.m 2009-01-10 05:01:34 UTC (rev 783)
+++ MacRuby/trunk/objc.m 2009-01-10 05:24:32 UTC (rev 784)
@@ -186,8 +186,9 @@
GC_ROOT(&ary_ffi_types);
}
- if (st_lookup(ary_ffi_types, (st_data_t)size, (st_data_t *)&type))
+ if (st_lookup(ary_ffi_types, (st_data_t)size, (st_data_t *)&type)) {
return type;
+ }
type = (ffi_type *)malloc(sizeof(ffi_type));
@@ -196,8 +197,9 @@
type->type = FFI_TYPE_STRUCT;
type->elements = malloc(size * sizeof(ffi_type *));
- for (i = 0; i < size; i++)
+ for (i = 0; i < size; i++) {
type->elements[i] = &ffi_type_uchar;
+ }
st_insert(ary_ffi_types, (st_data_t)size, (st_data_t)type);