summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/dl/cptr.c11
-rw-r--r--version.h2
3 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e66a9d7c5..76c292e04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat May 23 18:48:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dl/cptr.c (rb_dlptr_cmp): return signed value, and restric
+ to Fixnum. [ruby-dev:38533]
+
Fri May 22 18:44:34 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* instruby.rb (rdoc): considers --program-prefix and --program-suffix
diff --git a/ext/dl/cptr.c b/ext/dl/cptr.c
index 3c08e68cd..dbe93308b 100644
--- a/ext/dl/cptr.c
+++ b/ext/dl/cptr.c
@@ -317,10 +317,13 @@ rb_dlptr_eql(VALUE self, VALUE other)
VALUE
rb_dlptr_cmp(VALUE self, VALUE other)
{
- void *ptr1, *ptr2;
- ptr1 = rb_dlptr2cptr(self);
- ptr2 = rb_dlptr2cptr(other);
- return PTR2NUM((long)ptr1 - (long)ptr2);
+ void *ptr1, *ptr2;
+ SIGNED_VALUE diff;
+ ptr1 = rb_dlptr2cptr(self);
+ ptr2 = rb_dlptr2cptr(other);
+ diff = (SIGNED_VALUE)ptr1 - (SIGNED_VALUE)ptr2;
+ if (!diff) return INT2FIX(0);
+ return diff > 0 ? INT2NUM(1) : INT2NUM(-1);
}
VALUE
diff --git a/version.h b/version.h
index 1d832bf53..1d26532a3 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "1.9.1"
#define RUBY_RELEASE_DATE "2009-05-22"
-#define RUBY_PATCHLEVEL 154
+#define RUBY_PATCHLEVEL 155
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1