public
Description: Rubinius, the Ruby VM
Homepage: http://rubini.us
Clone URL: git://github.com/evanphx/rubinius.git
Fixing rb_obj_is_kind_of() in subtend, maybe a little hacky.
cezarsa (author)
Tue May 27 14:23:59 -0700 2008
commit  d48422eb53a4f49cd9bbf3619c4622bed8e7741c
tree    05190ff3da94dad9482f5c339d0f30c42c97dd42
parent  508da6b6261844b63f5ede00150a03bc1a2f006c
...
330
331
332
333
 
 
 
334
335
336
...
330
331
332
 
333
334
335
336
337
338
0
@@ -330,7 +330,9 @@ VALUE rb_obj_is_instance_of(VALUE obj, VALUE klass) {
0
 }
0
 
0
 VALUE rb_obj_is_kind_of(VALUE obj, VALUE klass) {
0
-  return rb_funcall(obj, rb_intern("kind_of?"), 1, klass);
0
+  CTX;
0
+  //HACK ? Calling rb_funcall() causes segmentation fault
0
+  return object_kind_of_p(ctx->state, HNDL(obj), HNDL(klass)) ? Qtrue : Qfalse;
0
 }
0
 
0
 int rb_respond_to(VALUE obj, ID sym) {
...
1
2
3
4
...
 
1
2
3
0
@@ -1,4 +1,3 @@
0
-fails:SubtendObject rb_is_kind_of should return true if an object is an instance or descendent
0
 fails:SubtendObject rb_to_id should return a symbol representation of the object
0
 fails:SubtendObject rb_check_array_type should try to coerce to array, otherwise return nil
0
 fails:SubtendObject rb_check_convert_type should try to coerce to a type, otherwise return nil

Comments