summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-17 06:38:58 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-17 06:38:58 +0000
commit97ef23675d8f5afe43d60a33d6ad50e784aeeed6 (patch)
tree2c3fd264a6fd4770b3d80a12cc4153e6abba244b
parent2e753992eb952e179f493a4f5877ae7c421b7908 (diff)
merges r21179 from trunk into ruby_1_9_1.
* pack.c (pack_pack): template f should not accept non float values. [ruby-dev:37656] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--include/ruby/intern.h1
-rw-r--r--pack.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 74df7c3b3..382e4ca38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Dec 29 22:37:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * pack.c (pack_pack): template f should not accept non float
+ values. [ruby-dev:37656]
+
+ * object.c (rb_to_float): new function to type check floats.
+
Fri Jan 16 18:43:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* tool/make-snapshot (package): includes all rules and expand
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 0e282c679..07ab6749a 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -452,6 +452,7 @@ VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
VALUE rb_check_to_integer(VALUE, const char *);
VALUE rb_to_int(VALUE);
VALUE rb_Integer(VALUE);
+VALUE rb_to_float(VALUE);
VALUE rb_Float(VALUE);
VALUE rb_String(VALUE);
VALUE rb_Array(VALUE);
diff --git a/pack.c b/pack.c
index 4f2533f2d..077baff04 100644
--- a/pack.c
+++ b/pack.c
@@ -789,7 +789,7 @@ pack_pack(VALUE ary, VALUE fmt)
float f;
from = NEXTFROM;
- f = RFLOAT_VALUE(rb_Float(from));
+ f = RFLOAT_VALUE(rb_to_float(from));
rb_str_buf_cat(res, (char*)&f, sizeof(float));
}
break;