1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* encoding.c (check_encoding): Check T_DATA or not.

is_data_encoding(obj) assumes that `obj' is T_DATA.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2013-07-25 07:19:59 +00:00
parent 276457dfac
commit 72293b69f8
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu Jul 25 16:17:55 2013 Koichi Sasada <ko1@atdot.net>
* encoding.c (check_encoding): Check T_DATA or not.
is_data_encoding(obj) assumes that `obj' is T_DATA.
Thu Jul 25 13:06:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (dir_s_home): use rb_home_dir_of and rb_default_home_dir.

View file

@ -121,7 +121,7 @@ check_encoding(rb_encoding *enc)
static int
enc_check_encoding(VALUE obj)
{
if (!is_data_encoding(obj)) {
if (!RB_TYPE_P(obj, T_DATA) || !is_data_encoding(obj)) {
return -1;
}
return check_encoding(RDATA(obj)->data);