[macruby-changes] [1722] MacRuby/branches/experimental/object.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 4 14:34:34 PDT 2009


Revision: 1722
          http://trac.macosforge.org/projects/ruby/changeset/1722
Author:   lsansonetti at apple.com
Date:     2009-06-04 14:34:33 -0700 (Thu, 04 Jun 2009)
Log Message:
-----------
ByteString objects can now be frozen/tainted (implementation wise it uses the generic hash, we should move the state within the ByteString instance later)

Modified Paths:
--------------
    MacRuby/branches/experimental/object.c

Modified: MacRuby/branches/experimental/object.c
===================================================================
--- MacRuby/branches/experimental/object.c	2009-06-04 21:33:45 UTC (rev 1721)
+++ MacRuby/branches/experimental/object.c	2009-06-04 21:34:33 UTC (rev 1722)
@@ -779,8 +779,8 @@
 	switch (TYPE(obj)) {
 	    case T_STRING:
 		if (*(VALUE *)obj == rb_cByteString) {
-		    // TODO
-		    return Qfalse;
+		    return rb_objc_flag_check((const void *)obj, FL_TAINT)
+			? Qtrue : Qfalse;
 		}
 		// fall through
 	    case T_ARRAY:
@@ -815,8 +815,8 @@
 	switch (TYPE(obj)) {
 	    case T_STRING:
 		if (*(VALUE *)obj == rb_cByteString) {
-		    // TODO
-		    return obj;
+		    rb_objc_flag_set((const void *)obj, FL_TAINT, true);
+		    break;
 		}
 		// fall through
 	    case T_ARRAY:
@@ -925,8 +925,8 @@
 	    switch(TYPE(obj)) {
 		case T_STRING:
 		if (*(VALUE *)obj == rb_cByteString) {
-		    // TODO
-		    return obj;
+		    rb_objc_flag_set((const void *)obj, FL_FREEZE, true);
+		    break;
 		}
 		// fall through
 		case T_ARRAY:
@@ -971,8 +971,8 @@
     switch (TYPE(obj)) {
 	case T_STRING:
 	    if (*(VALUE *)obj == rb_cByteString) {
-		// TODO
-		return Qfalse;
+		return rb_objc_flag_check((const void *)obj, FL_FREEZE)
+		    ? Qtrue : Qfalse;
 	    }
 	    // fall through
 	case T_ARRAY:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090604/23aed039/attachment-0001.html>


More information about the macruby-changes mailing list