aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-25 11:21:08 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-25 11:21:08 +0000
commited91275a9889d780cc44d56992bd439d45656838 (patch)
tree92c7be188cd004ed7d3b53714bd434ae923f22dd
parenta31918d6353dc46d07caec9a6ef30af3eb4b2cac (diff)
downloadruby-ed91275a9889d780cc44d56992bd439d45656838.tar.gz
* ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate
values have VALUE type. there is an environment where sizeof(VALUE) != sizeof(int) like IA64. if 32bit integer (Qtrue) is passed to ANYARGS and received by 64bit integer (VALUE), upper bits may have garbage value. [ruby-dev:27513] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--ruby.h8
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index ed2db79ce9..e986db75aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Oct 25 20:06:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate
+ values have VALUE type. there is an environment where sizeof(VALUE)
+ != sizeof(int) like IA64. if 32bit integer (Qtrue) is passed to ANYARGS
+ and received by 64bit integer (VALUE), upper bits may have garbage value.
+ [ruby-dev:27513]
+
Tue Oct 25 14:21:46 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* gc.c (garbage_collect): sorry, previous commit was incorrect.
diff --git a/ruby.h b/ruby.h
index 02b305ad18..1fcf276a21 100644
--- a/ruby.h
+++ b/ruby.h
@@ -187,10 +187,10 @@ VALUE rb_ull2inum(unsigned LONG_LONG);
#define SYM2ID(x) RSHIFT((long)x,8)
/* special contants - i.e. non-zero and non-fixnum constants */
-#define Qfalse 0
-#define Qtrue 2
-#define Qnil 4
-#define Qundef 6 /* undefined value for placeholder */
+#define Qfalse ((VALUE)0)
+#define Qtrue ((VALUE)2)
+#define Qnil ((VALUE)4)
+#define Qundef ((VALUE)6) /* undefined value for placeholder */
#define RTEST(v) (((VALUE)(v) & ~Qnil) != 0)
#define NIL_P(v) ((VALUE)(v) == Qnil)