[macruby-changes] [4942] MacRuby/trunk/include/ruby/ruby.h
source_changes at macosforge.org
source_changes at macosforge.org
Wed Nov 24 09:23:44 PST 2010
Revision: 4942
http://trac.macosforge.org/projects/ruby/changeset/4942
Author: watson1978 at gmail.com
Date: 2010-11-24 09:23:41 -0800 (Wed, 24 Nov 2010)
Log Message:
-----------
modified the macro of OBJ_INFECT.
Modified Paths:
--------------
MacRuby/trunk/include/ruby/ruby.h
Modified: MacRuby/trunk/include/ruby/ruby.h
===================================================================
--- MacRuby/trunk/include/ruby/ruby.h 2010-11-24 15:25:23 UTC (rev 4941)
+++ MacRuby/trunk/include/ruby/ruby.h 2010-11-24 17:23:41 UTC (rev 4942)
@@ -710,7 +710,16 @@
#define OBJ_UNTRUSTED(x) (int)(SPECIAL_CONST_P(x) || NATIVE(x) ? rb_obj_untrusted((VALUE)x) == Qtrue : FL_TEST((x), FL_UNTRUSTED))
#define OBJ_UNTRUST(x) (rb_obj_untrust((VALUE)x))
-#define OBJ_INFECT(x,s) do {if (FL_ABLE(x) && FL_ABLE(s)) RBASIC(x)->flags |= RBASIC(s)->flags & FL_TAINT;} while (0)
+#define OBJ_INFECT(x,s) \
+ do { \
+ if (OBJ_TAINTED(s)) { \
+ OBJ_TAINT(x); \
+ } \
+ if (OBJ_UNTRUSTED(s)) { \
+ OBJ_UNTRUST(x); \
+ } \
+ } \
+ while (0)
#define OBJ_FROZEN(x) (int)(SPECIAL_CONST_P(x) || NATIVE(x) ? rb_obj_frozen_p((VALUE)x) == Qtrue : FL_TEST((x), FL_FREEZE))
#define OBJ_FREEZE(x) (rb_obj_freeze((VALUE)x))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101124/964ec3fb/attachment.html>
More information about the macruby-changes
mailing list