mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ruby.c (proc_options): unexpected SecurityError happens when -T4.
* regex.c (re_compile_pattern): * \1 .. \9 should be backreferences always. * regex.c (re_match): backreferences corresponding to unclosed/unmatched parentheses should fail always. * string.c (rb_str_cat): use rb_str_buf_cat() if possible. [new] * string.c (rb_str_append): ditto. * string.c (rb_str_buf_cat): remove unnecessary check (type, taint, modify) to gain performance. * string.c (rb_str_buf_append): ditto. * string.c (rb_str_buf_new): buffering string function. [new] * string.c (rb_str_buf_append): ditto. * string.c (rb_str_buf_cat): ditto. * time.c (make_time_t): local time adjustment revised. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4cd1cd7201
commit
abfaac7a6c
24 changed files with 925 additions and 423 deletions
12
class.c
12
class.c
|
@ -484,19 +484,29 @@ rb_class_private_instance_methods(argc, argv, mod)
|
|||
}
|
||||
|
||||
VALUE
|
||||
rb_obj_singleton_methods(obj)
|
||||
rb_obj_singleton_methods(argc, argv, obj)
|
||||
int argc;
|
||||
VALUE *argv;
|
||||
VALUE obj;
|
||||
{
|
||||
VALUE all;
|
||||
VALUE ary;
|
||||
VALUE klass;
|
||||
VALUE *p, *q, *pend;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &all);
|
||||
ary = rb_ary_new();
|
||||
klass = CLASS_OF(obj);
|
||||
while (klass && FL_TEST(klass, FL_SINGLETON)) {
|
||||
st_foreach(RCLASS(klass)->m_tbl, ins_methods_i, ary);
|
||||
klass = RCLASS(klass)->super;
|
||||
}
|
||||
if (RTEST(all)) {
|
||||
while (klass && TYPE(klass) == T_ICLASS) {
|
||||
st_foreach(RCLASS(klass)->m_tbl, ins_methods_i, ary);
|
||||
klass = RCLASS(klass)->super;
|
||||
}
|
||||
}
|
||||
p = q = RARRAY(ary)->ptr; pend = p + RARRAY(ary)->len;
|
||||
while (p < pend) {
|
||||
if (*p == Qnil) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue