matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
afa2732b78
commit
03581d5826
48
ChangeLog
48
ChangeLog
@ -2,6 +2,54 @@ Mon Dec 4 13:44:01 2000 WATANABE Hirofumi <eban@ruby-lang.org>
|
|||||||
|
|
||||||
* lib/jcode.rb: consider multibyte. not /n.
|
* lib/jcode.rb: consider multibyte. not /n.
|
||||||
|
|
||||||
|
Mon Dec 4 09:49:36 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_str_inspect): output whole string contents. no more `...'
|
||||||
|
|
||||||
|
* string.c (rb_str_dump): should propagate taintness.
|
||||||
|
|
||||||
|
* hash.c (env_inspect): hash like human readable output.
|
||||||
|
|
||||||
|
* variable.c (rb_ivar_get): prohibiting instance variable access
|
||||||
|
is too much restriction.
|
||||||
|
|
||||||
|
* class.c (method_list): retrieving information should not be
|
||||||
|
restricted where $SAFE=4.
|
||||||
|
|
||||||
|
* class.c (rb_obj_singleton_methods): ditto.
|
||||||
|
|
||||||
|
* eval.c (rb_thread_priority): ditto.
|
||||||
|
|
||||||
|
* eval.c (rb_thread_local_aref): ditto.
|
||||||
|
|
||||||
|
* variable.c (rb_obj_instance_variables): ditto.
|
||||||
|
|
||||||
|
* variable.c (rb_mod_const_at): ditto.
|
||||||
|
|
||||||
|
* variable.c (rb_mod_class_variables): ditto.
|
||||||
|
|
||||||
|
* eval.c (rb_exec_end_proc): end_proc should be preserved.
|
||||||
|
|
||||||
|
Sat Dec 2 22:32:43 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_yield_0): || should accept exactly zero argument.
|
||||||
|
|
||||||
|
* parse.y (stmt): multiple right hand side for single assignment
|
||||||
|
(e.g. a = 1,2) is allowed.
|
||||||
|
|
||||||
|
Wed Nov 29 07:55:29 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* marshal.c (w_long): dumping long should be smaller than 32bit max.
|
||||||
|
|
||||||
|
* marshal.c (w_long): shorter long format for small integers(-123..122).
|
||||||
|
|
||||||
|
* marshal.c (r_long): ditto.
|
||||||
|
|
||||||
|
Tue Nov 28 18:10:51 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_mod_define_method): quick hack to implement
|
||||||
|
on-the-fly method definition. experimental.
|
||||||
|
|
||||||
Mon Nov 27 17:00:35 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Mon Nov 27 17:00:35 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (rb_eval): should not redefine builtin classes/modules
|
* eval.c (rb_eval): should not redefine builtin classes/modules
|
||||||
|
11
ToDo
11
ToDo
@ -23,10 +23,11 @@ Language Spec.
|
|||||||
* Fixnum 0 as false ????
|
* Fixnum 0 as false ????
|
||||||
* discourage use of symbol variable (e.g. $/, etc.) in manual
|
* discourage use of symbol variable (e.g. $/, etc.) in manual
|
||||||
* discourage use of Perlish features by giving warnings.
|
* discourage use of Perlish features by giving warnings.
|
||||||
* `exception' method to be alternative for `$!'. ??
|
|
||||||
* non confusing in-block local variable (is it possible?)
|
* non confusing in-block local variable (is it possible?)
|
||||||
+ remove scope by block
|
+ remove scope by block
|
||||||
+ variables appears within block may have independent values.
|
+ variables appears within block may have independent values.
|
||||||
|
* Regexp: make /o thread safe.
|
||||||
|
* decide if begin with rescue or ensure make do..while loop.
|
||||||
|
|
||||||
Hacking Interpreter
|
Hacking Interpreter
|
||||||
|
|
||||||
@ -44,10 +45,11 @@ Hacking Interpreter
|
|||||||
* scrambled script, or script filter
|
* scrambled script, or script filter
|
||||||
* setuid ruby
|
* setuid ruby
|
||||||
* performance tune for in-block (dynamic) local variables.
|
* performance tune for in-block (dynamic) local variables.
|
||||||
* generational GC ?
|
* generational GC
|
||||||
* give warnings to assign magic variables.
|
* give warnings to assign magic variables.
|
||||||
* export rb_io_{addstr,printf,puts,print}
|
* export rb_io_{addstr,printf,puts,print}
|
||||||
* autoload should work with threads [ruby-talk:4589]
|
* autoload should work with threads [ruby-talk:4589]
|
||||||
|
* remove stdio dependency from IOs.
|
||||||
|
|
||||||
Standard Libraries
|
Standard Libraries
|
||||||
|
|
||||||
@ -73,7 +75,7 @@ Standard Libraries
|
|||||||
- performance tune for String's non-bang methods.
|
- performance tune for String's non-bang methods.
|
||||||
- 'w' template for pack/unpack
|
- 'w' template for pack/unpack
|
||||||
- alternative for interator? => block_given?
|
- alternative for interator? => block_given?
|
||||||
- regex - /p (make obsolete), /m (new)
|
- regex - /p (made obsolete), /m (new)
|
||||||
- consistent /, %, divmod
|
- consistent /, %, divmod
|
||||||
- unbound method object
|
- unbound method object
|
||||||
- integrate final.rb into the core.
|
- integrate final.rb into the core.
|
||||||
@ -92,6 +94,7 @@ Standard Libraries
|
|||||||
* Process::waitall [ruby-talk:4557]
|
* Process::waitall [ruby-talk:4557]
|
||||||
* synchronized method - synchronized{...}, synchronized :foo, :bar
|
* synchronized method - synchronized{...}, synchronized :foo, :bar
|
||||||
* move Time::times to Process.
|
* move Time::times to Process.
|
||||||
|
* Module#define_method which takes a name and a body (block, proc or method).
|
||||||
|
|
||||||
Extension Libraries
|
Extension Libraries
|
||||||
|
|
||||||
@ -115,4 +118,4 @@ Tools
|
|||||||
Misc
|
Misc
|
||||||
|
|
||||||
- publish Ruby books
|
- publish Ruby books
|
||||||
* publish Ruby books in English
|
- publish Ruby books in English
|
||||||
|
97
array.c
97
array.c
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "ruby.h"
|
#include "ruby.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "st.h"
|
||||||
|
|
||||||
VALUE rb_cArray;
|
VALUE rb_cArray;
|
||||||
|
|
||||||
@ -1435,21 +1436,50 @@ rb_ary_diff(ary1, ary2)
|
|||||||
return ary3;
|
return ary3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static st_table*
|
||||||
|
ary_make_hash(ary1, ary2, func)
|
||||||
|
VALUE ary1, ary2;
|
||||||
|
int (*func)();
|
||||||
|
{
|
||||||
|
st_table *tbl = st_init_numtable();
|
||||||
|
int i, n;
|
||||||
|
|
||||||
|
for (i=0; i<RARRAY(ary1)->len; i++) {
|
||||||
|
if (!st_lookup(tbl, RARRAY(ary1)->ptr[i], &n)) {
|
||||||
|
st_add_direct(tbl, RARRAY(ary1)->ptr[i], 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ary2) {
|
||||||
|
for (i=0; i<RARRAY(ary2)->len; i++) {
|
||||||
|
if (st_lookup(tbl, RARRAY(ary2)->ptr[i], &n)) {
|
||||||
|
st_insert(tbl, RARRAY(ary2)->ptr[i], 2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
st_add_direct(tbl, RARRAY(ary2)->ptr[i], 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tbl;
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_ary_and(ary1, ary2)
|
rb_ary_and(ary1, ary2)
|
||||||
VALUE ary1, ary2;
|
VALUE ary1, ary2;
|
||||||
{
|
{
|
||||||
VALUE ary3;
|
st_table *tbl = ary_make_hash(ary1, to_ary(ary2));
|
||||||
|
VALUE ary3 = rb_ary_new();
|
||||||
|
VALUE v;
|
||||||
long i;
|
long i;
|
||||||
|
int n;
|
||||||
|
|
||||||
ary2 = to_ary(ary2);
|
|
||||||
ary3 = rb_ary_new();
|
|
||||||
for (i=0; i<RARRAY(ary1)->len; i++) {
|
for (i=0; i<RARRAY(ary1)->len; i++) {
|
||||||
if (rb_ary_includes(ary2, RARRAY(ary1)->ptr[i])
|
v = RARRAY(ary1)->ptr[i];
|
||||||
&& !rb_ary_includes(ary3, RARRAY(ary1)->ptr[i])) {
|
if (st_delete(tbl, &v, &n)) {
|
||||||
rb_ary_push(ary3, RARRAY(ary1)->ptr[i]);
|
if (n == 2) rb_ary_push(ary3, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
st_free_table(tbl);
|
||||||
|
|
||||||
return ary3;
|
return ary3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1457,23 +1487,28 @@ static VALUE
|
|||||||
rb_ary_or(ary1, ary2)
|
rb_ary_or(ary1, ary2)
|
||||||
VALUE ary1, ary2;
|
VALUE ary1, ary2;
|
||||||
{
|
{
|
||||||
VALUE ary3;
|
st_table *tbl;
|
||||||
|
VALUE ary3 = rb_ary_new();
|
||||||
|
VALUE v;
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
if (TYPE(ary2) != T_ARRAY) {
|
ary2 = to_ary(ary2);
|
||||||
if (rb_ary_includes(ary1, ary2)) return ary1;
|
tbl = ary_make_hash(ary1, ary2);
|
||||||
else return rb_ary_push(ary1, ary2);
|
|
||||||
}
|
|
||||||
|
|
||||||
ary3 = rb_ary_new();
|
|
||||||
for (i=0; i<RARRAY(ary1)->len; i++) {
|
for (i=0; i<RARRAY(ary1)->len; i++) {
|
||||||
if (!rb_ary_includes(ary3, RARRAY(ary1)->ptr[i]))
|
v = RARRAY(ary1)->ptr[i];
|
||||||
rb_ary_push(ary3, RARRAY(ary1)->ptr[i]);
|
if (st_delete(tbl, &v, 0)) {
|
||||||
|
rb_ary_push(ary3, v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (i=0; i<RARRAY(ary2)->len; i++) {
|
for (i=0; i<RARRAY(ary2)->len; i++) {
|
||||||
if (!rb_ary_includes(ary3, RARRAY(ary2)->ptr[i]))
|
v = RARRAY(ary2)->ptr[i];
|
||||||
rb_ary_push(ary3, RARRAY(ary2)->ptr[i]);
|
if (st_delete(tbl, &v, 0)) {
|
||||||
|
rb_ary_push(ary3, v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
st_free_table(tbl);
|
||||||
|
|
||||||
return ary3;
|
return ary3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1481,27 +1516,25 @@ static VALUE
|
|||||||
rb_ary_uniq_bang(ary)
|
rb_ary_uniq_bang(ary)
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
VALUE *p, *q, *t, *end;
|
st_table *tbl = ary_make_hash(ary, 0);
|
||||||
|
VALUE *p, *q, *end;
|
||||||
VALUE v;
|
VALUE v;
|
||||||
|
|
||||||
rb_ary_modify(ary);
|
if (RARRAY(ary)->len == tbl->num_entries) {
|
||||||
p = RARRAY(ary)->ptr;
|
st_free_table(tbl);
|
||||||
end = p + RARRAY(ary)->len;
|
|
||||||
|
|
||||||
while (p < end) {
|
|
||||||
v = *p++;
|
|
||||||
q = t = p;
|
|
||||||
while (q < end) {
|
|
||||||
if (rb_equal(*q, v)) q++;
|
|
||||||
else *t++ = *q++;
|
|
||||||
}
|
|
||||||
end = t;
|
|
||||||
}
|
|
||||||
if (RARRAY(ary)->len == (end - RARRAY(ary)->ptr)) {
|
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
rb_ary_modify(ary);
|
||||||
|
|
||||||
RARRAY(ary)->len = (end - RARRAY(ary)->ptr);
|
p = q = RARRAY(ary)->ptr;
|
||||||
|
end = p + RARRAY(ary)->len;
|
||||||
|
while (p < end) {
|
||||||
|
v = *p++;
|
||||||
|
if (st_delete(tbl, &v, 0)) {
|
||||||
|
*q++ = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RARRAY(ary)->len = (q - RARRAY(ary)->ptr);
|
||||||
|
|
||||||
return ary;
|
return ary;
|
||||||
}
|
}
|
||||||
|
4
class.c
4
class.c
@ -365,8 +365,6 @@ method_list(mod, option, func)
|
|||||||
VALUE klass;
|
VALUE klass;
|
||||||
VALUE *p, *q, *pend;
|
VALUE *p, *q, *pend;
|
||||||
|
|
||||||
if (!OBJ_TAINTED(mod) && rb_safe_level() >= 4)
|
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't get metainfo");
|
|
||||||
ary = rb_ary_new();
|
ary = rb_ary_new();
|
||||||
for (klass = mod; klass; klass = RCLASS(klass)->super) {
|
for (klass = mod; klass; klass = RCLASS(klass)->super) {
|
||||||
st_foreach(RCLASS(klass)->m_tbl, func, ary);
|
st_foreach(RCLASS(klass)->m_tbl, func, ary);
|
||||||
@ -428,8 +426,6 @@ rb_obj_singleton_methods(obj)
|
|||||||
VALUE klass;
|
VALUE klass;
|
||||||
VALUE *p, *q, *pend;
|
VALUE *p, *q, *pend;
|
||||||
|
|
||||||
if (rb_safe_level() >= 4 && !OBJ_TAINTED(obj))
|
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't get metainfo");
|
|
||||||
ary = rb_ary_new();
|
ary = rb_ary_new();
|
||||||
klass = CLASS_OF(obj);
|
klass = CLASS_OF(obj);
|
||||||
while (klass && FL_TEST(klass, FL_SINGLETON)) {
|
while (klass && FL_TEST(klass, FL_SINGLETON)) {
|
||||||
|
89
eval.c
89
eval.c
@ -86,7 +86,10 @@ static VALUE rb_f_block_given_p _((void));
|
|||||||
static VALUE block_pass _((VALUE,NODE*));
|
static VALUE block_pass _((VALUE,NODE*));
|
||||||
static VALUE rb_cMethod;
|
static VALUE rb_cMethod;
|
||||||
static VALUE method_proc _((VALUE));
|
static VALUE method_proc _((VALUE));
|
||||||
|
static VALUE method_call _((int, VALUE*, VALUE));
|
||||||
static VALUE rb_cUnboundMethod;
|
static VALUE rb_cUnboundMethod;
|
||||||
|
static VALUE umethod_bind _((VALUE, VALUE));
|
||||||
|
static VALUE rb_mod_define_method _((int, VALUE*, VALUE));
|
||||||
|
|
||||||
static int scope_vmode;
|
static int scope_vmode;
|
||||||
#define SCOPE_PUBLIC 0
|
#define SCOPE_PUBLIC 0
|
||||||
@ -1114,7 +1117,7 @@ ruby_options(argc, argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rb_exec_end_proc _((void));
|
void rb_exec_end_proc _((void));
|
||||||
|
|
||||||
void
|
void
|
||||||
ruby_finalize()
|
ruby_finalize()
|
||||||
@ -3458,14 +3461,24 @@ rb_yield_0(val, self, klass, acheck)
|
|||||||
if (block->var) {
|
if (block->var) {
|
||||||
PUSH_TAG(PROT_NONE);
|
PUSH_TAG(PROT_NONE);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
if (nd_type(block->var) == NODE_MASGN)
|
if (block->var == (NODE*)1) {
|
||||||
massign(self, block->var, val, acheck);
|
|
||||||
else {
|
|
||||||
if (acheck && val != Qundef &&
|
if (acheck && val != Qundef &&
|
||||||
TYPE(val) == T_ARRAY && RARRAY(val)->len == 1) {
|
TYPE(val) == T_ARRAY && RARRAY(val)->len != 0) {
|
||||||
val = RARRAY(val)->ptr[0];
|
rb_raise(rb_eArgError, "wrong # of arguments (%d for 0)",
|
||||||
|
RARRAY(val)->len);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (nd_type(block->var) == NODE_MASGN)
|
||||||
|
massign(self, block->var, val, acheck);
|
||||||
|
else {
|
||||||
|
/* argument adjust for proc_call etc. */
|
||||||
|
if (acheck && val != Qundef &&
|
||||||
|
TYPE(val) == T_ARRAY && RARRAY(val)->len == 1) {
|
||||||
|
val = RARRAY(val)->ptr[0];
|
||||||
|
}
|
||||||
|
assign(self, block->var, val, acheck);
|
||||||
}
|
}
|
||||||
assign(self, block->var, val, acheck);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
@ -4210,6 +4223,14 @@ rb_call0(klass, recv, id, argc, argv, body, nosuper)
|
|||||||
result = rb_eval(recv, body);
|
result = rb_eval(recv, body);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NODE_DMETHOD:
|
||||||
|
result = method_call(argc, argv, umethod_bind(body->nd_cval, recv));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NODE_BMETHOD:
|
||||||
|
result = proc_call(body->nd_cval, rb_ary_new4(argc, argv));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
int state;
|
int state;
|
||||||
@ -5639,20 +5660,19 @@ rb_f_at_exit()
|
|||||||
return proc;
|
return proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
rb_exec_end_proc()
|
rb_exec_end_proc()
|
||||||
{
|
{
|
||||||
struct end_proc_data *link;
|
struct end_proc_data *link;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
while (end_procs) {
|
link = end_procs;
|
||||||
link = end_procs;
|
while (link) {
|
||||||
end_procs = link->next;
|
|
||||||
rb_protect((VALUE(*)())link->func, link->data, &status);
|
rb_protect((VALUE(*)())link->func, link->data, &status);
|
||||||
if (status) {
|
if (status) {
|
||||||
error_handle(status);
|
error_handle(status);
|
||||||
}
|
}
|
||||||
free(link);
|
link = link->next;
|
||||||
}
|
}
|
||||||
while (ephemeral_end_procs) {
|
while (ephemeral_end_procs) {
|
||||||
link = ephemeral_end_procs;
|
link = ephemeral_end_procs;
|
||||||
@ -5737,6 +5757,7 @@ Init_eval()
|
|||||||
rb_define_private_method(rb_cModule, "remove_method", rb_mod_remove_method, 1);
|
rb_define_private_method(rb_cModule, "remove_method", rb_mod_remove_method, 1);
|
||||||
rb_define_private_method(rb_cModule, "undef_method", rb_mod_undef_method, 1);
|
rb_define_private_method(rb_cModule, "undef_method", rb_mod_undef_method, 1);
|
||||||
rb_define_private_method(rb_cModule, "alias_method", rb_mod_alias_method, 2);
|
rb_define_private_method(rb_cModule, "alias_method", rb_mod_alias_method, 2);
|
||||||
|
rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1);
|
||||||
|
|
||||||
rb_define_singleton_method(rb_cModule, "nesting", rb_mod_nesting, 0);
|
rb_define_singleton_method(rb_cModule, "nesting", rb_mod_nesting, 0);
|
||||||
rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, 0);
|
rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, 0);
|
||||||
@ -6163,6 +6184,7 @@ proc_arity(proc)
|
|||||||
|
|
||||||
Data_Get_Struct(proc, struct BLOCK, data);
|
Data_Get_Struct(proc, struct BLOCK, data);
|
||||||
if (data->var == 0) return INT2FIX(-1);
|
if (data->var == 0) return INT2FIX(-1);
|
||||||
|
if (data->var == (NODE*)1) return INT2FIX(0);
|
||||||
switch (nd_type(data->var)) {
|
switch (nd_type(data->var)) {
|
||||||
default:
|
default:
|
||||||
return INT2FIX(-1);
|
return INT2FIX(-1);
|
||||||
@ -6540,6 +6562,42 @@ umethod_proc(method)
|
|||||||
return rb_iterate(mproc, 0, umcall, method);
|
return rb_iterate(mproc, 0, umcall, method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
rb_mod_define_method(argc, argv, mod)
|
||||||
|
int argc;
|
||||||
|
VALUE *argv;
|
||||||
|
VALUE mod;
|
||||||
|
{
|
||||||
|
ID id;
|
||||||
|
VALUE name, body;
|
||||||
|
|
||||||
|
if (argc == 1) {
|
||||||
|
id = rb_to_id(argv[0]);
|
||||||
|
body = rb_f_lambda();
|
||||||
|
}
|
||||||
|
else if (argc == 2) {
|
||||||
|
id = rb_to_id(argv[0]);
|
||||||
|
body = argv[1];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)", argc);
|
||||||
|
}
|
||||||
|
if (TYPE(body) != T_DATA) {
|
||||||
|
/* type error */
|
||||||
|
}
|
||||||
|
if (RDATA(body)->dmark == bm_mark) {
|
||||||
|
rb_add_method(mod, id, NEW_DMETHOD(method_unbind(body)), NOEX_PUBLIC);
|
||||||
|
}
|
||||||
|
else if (RDATA(body)->dmark != blk_mark) {
|
||||||
|
rb_add_method(mod, id, NEW_BMETHOD(body), NOEX_PUBLIC);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* type error */
|
||||||
|
}
|
||||||
|
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Init_Proc()
|
Init_Proc()
|
||||||
{
|
{
|
||||||
@ -7609,12 +7667,7 @@ static VALUE
|
|||||||
rb_thread_priority(thread)
|
rb_thread_priority(thread)
|
||||||
VALUE thread;
|
VALUE thread;
|
||||||
{
|
{
|
||||||
rb_thread_t th = rb_thread_check(thread);;
|
return INT2NUM(rb_thread_check(thread)->priority);
|
||||||
|
|
||||||
if (rb_safe_level() >= 4 && th != curr_thread) {
|
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't get priority");
|
|
||||||
}
|
|
||||||
return INT2NUM(th->priority);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
30
hash.c
30
hash.c
@ -1256,6 +1256,35 @@ env_to_s()
|
|||||||
return rb_str_new2("ENV");
|
return rb_str_new2("ENV");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
env_inspect()
|
||||||
|
{
|
||||||
|
char **env;
|
||||||
|
VALUE str = rb_str_new2("{");
|
||||||
|
VALUE i;
|
||||||
|
|
||||||
|
env = environ;
|
||||||
|
while (*env) {
|
||||||
|
char *s = strchr(*env, '=');
|
||||||
|
|
||||||
|
if (env != environ) {
|
||||||
|
rb_str_cat2(str, ", ");
|
||||||
|
}
|
||||||
|
if (s) {
|
||||||
|
rb_str_cat2(str, "\"");
|
||||||
|
rb_str_cat(str, *env, s-*env);
|
||||||
|
rb_str_cat2(str, "\"=>");
|
||||||
|
i = rb_inspect(rb_str_new2(s+1));
|
||||||
|
rb_str_append(str, i);
|
||||||
|
}
|
||||||
|
env++;
|
||||||
|
}
|
||||||
|
rb_str_cat2(str, "}");
|
||||||
|
OBJ_TAINT(str);
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
env_to_a()
|
env_to_a()
|
||||||
{
|
{
|
||||||
@ -1473,6 +1502,7 @@ Init_Hash()
|
|||||||
rb_define_singleton_method(envtbl,"reject", env_reject, 0);
|
rb_define_singleton_method(envtbl,"reject", env_reject, 0);
|
||||||
rb_define_singleton_method(envtbl,"reject!", env_reject_bang, 0);
|
rb_define_singleton_method(envtbl,"reject!", env_reject_bang, 0);
|
||||||
rb_define_singleton_method(envtbl,"to_s", env_to_s, 0);
|
rb_define_singleton_method(envtbl,"to_s", env_to_s, 0);
|
||||||
|
rb_define_singleton_method(envtbl,"inspect", env_inspect, 0);
|
||||||
rb_define_singleton_method(envtbl,"rehash", env_none, 0);
|
rb_define_singleton_method(envtbl,"rehash", env_none, 0);
|
||||||
rb_define_singleton_method(envtbl,"to_a", env_to_a, 0);
|
rb_define_singleton_method(envtbl,"to_a", env_to_a, 0);
|
||||||
rb_define_singleton_method(envtbl,"index", env_index, 1);
|
rb_define_singleton_method(envtbl,"index", env_index, 1);
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
module Find
|
module Find
|
||||||
def find(*path)
|
def find(*path)
|
||||||
|
path.collect!{|d| d.dup}
|
||||||
while file = path.shift
|
while file = path.shift
|
||||||
catch(:prune) do
|
catch(:prune) do
|
||||||
yield file
|
yield file
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
# jcode.rb - ruby code to handle japanese (EUC/SJIS) string
|
# jcode.rb - ruby code to handle japanese (EUC/SJIS) string
|
||||||
|
|
||||||
|
if $VERBOSE && $KCODE == "NONE"
|
||||||
|
STDERR.puts "Warning: $KCODE is NONE."
|
||||||
|
end
|
||||||
|
|
||||||
$vsave, $VERBOSE = $VERBOSE, false
|
$vsave, $VERBOSE = $VERBOSE, false
|
||||||
class String
|
class String
|
||||||
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
|
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
|
||||||
|
25
marshal.c
25
marshal.c
@ -52,7 +52,7 @@ shortlen(len, ds)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MARSHAL_MAJOR 4
|
#define MARSHAL_MAJOR 4
|
||||||
#define MARSHAL_MINOR 4
|
#define MARSHAL_MINOR 5
|
||||||
|
|
||||||
#define TYPE_NIL '0'
|
#define TYPE_NIL '0'
|
||||||
#define TYPE_TRUE 'T'
|
#define TYPE_TRUE 'T'
|
||||||
@ -143,10 +143,25 @@ w_long(x, arg)
|
|||||||
char buf[sizeof(long)+1];
|
char buf[sizeof(long)+1];
|
||||||
int i, len = 0;
|
int i, len = 0;
|
||||||
|
|
||||||
|
#if SIZEOF_LONG > 4
|
||||||
|
if (!(RSHIFT(x, 32) == 0 || RSHIFT(x, 32) == -1)) {
|
||||||
|
/* big long does not fit in 4 bytes */
|
||||||
|
rb_raise(rb_eTypeError, "long too big to dump");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (x == 0) {
|
if (x == 0) {
|
||||||
w_byte(0, arg);
|
w_byte(0, arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (0 < x && x < 123) {
|
||||||
|
w_byte(x + 5, arg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (-124 < x && x < 0) {
|
||||||
|
w_byte((x - 5)&0xff, arg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (i=1;i<sizeof(long)+1;i++) {
|
for (i=1;i<sizeof(long)+1;i++) {
|
||||||
buf[i] = x & 0xff;
|
buf[i] = x & 0xff;
|
||||||
x = RSHIFT(x,8);
|
x = RSHIFT(x,8);
|
||||||
@ -597,11 +612,14 @@ r_long(arg)
|
|||||||
struct load_arg *arg;
|
struct load_arg *arg;
|
||||||
{
|
{
|
||||||
register long x;
|
register long x;
|
||||||
int c = r_byte(arg);
|
int c = (char)r_byte(arg);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (c == 0) return 0;
|
if (c == 0) return 0;
|
||||||
if (c > 0) {
|
if (c > 0) {
|
||||||
|
if (4 < c && c < 128) {
|
||||||
|
return c - 5;
|
||||||
|
}
|
||||||
if (c > sizeof(long)) long_toobig(c);
|
if (c > sizeof(long)) long_toobig(c);
|
||||||
x = 0;
|
x = 0;
|
||||||
for (i=0;i<c;i++) {
|
for (i=0;i<c;i++) {
|
||||||
@ -609,6 +627,9 @@ r_long(arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (-129 < c && c < -4) {
|
||||||
|
return c + 5;
|
||||||
|
}
|
||||||
c = -c;
|
c = -c;
|
||||||
if (c > sizeof(long)) long_toobig(c);
|
if (c > sizeof(long)) long_toobig(c);
|
||||||
x = -1;
|
x = -1;
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
(defconst ruby-negative
|
(defconst ruby-negative
|
||||||
(concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|\\("
|
(concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|\\("
|
||||||
ruby-block-end-re "\\)\\>\\|\\}\\|\\]\\)")
|
ruby-block-end-re "\\)\\>\\|}\\|\\]\\)")
|
||||||
)
|
)
|
||||||
|
|
||||||
(defconst ruby-operator-chars "-,.+*/%&|^~=<>:")
|
(defconst ruby-operator-chars "-,.+*/%&|^~=<>:")
|
||||||
@ -549,7 +549,7 @@ The variable ruby-indent-level controls the amount of indentation.
|
|||||||
(and (not (eolp))
|
(and (not (eolp))
|
||||||
(progn
|
(progn
|
||||||
(forward-char -1)
|
(forward-char -1)
|
||||||
(not (looking-at "\\{")))
|
(not (looking-at "{")))
|
||||||
(progn
|
(progn
|
||||||
(forward-word -1)
|
(forward-word -1)
|
||||||
(not (looking-at "do\\>[^_]")))))
|
(not (looking-at "do\\>[^_]")))))
|
||||||
|
4
node.h
4
node.h
@ -117,6 +117,8 @@ enum node_type {
|
|||||||
#ifdef C_ALLOCA
|
#ifdef C_ALLOCA
|
||||||
NODE_ALLOCA,
|
NODE_ALLOCA,
|
||||||
#endif
|
#endif
|
||||||
|
NODE_DMETHOD,
|
||||||
|
NODE_BMETHOD,
|
||||||
NODE_MEMO,
|
NODE_MEMO,
|
||||||
NODE_LAST
|
NODE_LAST
|
||||||
};
|
};
|
||||||
@ -324,6 +326,8 @@ typedef struct RNode {
|
|||||||
#define NEW_NEWLINE(n) rb_node_newnode(NODE_NEWLINE,0,0,n)
|
#define NEW_NEWLINE(n) rb_node_newnode(NODE_NEWLINE,0,0,n)
|
||||||
#define NEW_PREEXE(b) NEW_SCOPE(b)
|
#define NEW_PREEXE(b) NEW_SCOPE(b)
|
||||||
#define NEW_POSTEXE() rb_node_newnode(NODE_POSTEXE,0,0,0)
|
#define NEW_POSTEXE() rb_node_newnode(NODE_POSTEXE,0,0,0)
|
||||||
|
#define NEW_DMETHOD(b) rb_node_newnode(NODE_DMETHOD,0,0,b)
|
||||||
|
#define NEW_BMETHOD(b) rb_node_newnode(NODE_BMETHOD,0,0,b)
|
||||||
|
|
||||||
#define NOEX_PUBLIC 0
|
#define NOEX_PUBLIC 0
|
||||||
#define NOEX_UNDEF 1
|
#define NOEX_UNDEF 1
|
||||||
|
36
parse.y
36
parse.y
@ -188,7 +188,7 @@ static void top_local_setup();
|
|||||||
%type <node> if_tail opt_else case_body cases rescue exc_list exc_var ensure
|
%type <node> if_tail opt_else case_body cases rescue exc_list exc_var ensure
|
||||||
%type <node> opt_call_args call_args ret_args args when_args
|
%type <node> opt_call_args call_args ret_args args when_args
|
||||||
%type <node> aref_args opt_block_arg block_arg stmt_rhs
|
%type <node> aref_args opt_block_arg block_arg stmt_rhs
|
||||||
%type <node> mrhs superclass generic_call block_call var_ref
|
%type <node> mrhs mrhs_basic superclass generic_call block_call var_ref
|
||||||
%type <node> f_arglist f_args f_optarg f_opt f_block_arg opt_f_block_arg
|
%type <node> f_arglist f_args f_optarg f_opt f_block_arg opt_f_block_arg
|
||||||
%type <node> assoc_list assocs assoc undef_list backref
|
%type <node> assoc_list assocs assoc undef_list backref
|
||||||
%type <node> block_var opt_block_var brace_block do_block lhs none
|
%type <node> block_var opt_block_var brace_block do_block lhs none
|
||||||
@ -407,6 +407,10 @@ stmt : block_call
|
|||||||
$1->nd_value = $3;
|
$1->nd_value = $3;
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
|
| lhs '=' mrhs_basic
|
||||||
|
{
|
||||||
|
$$ = node_assign($1, $3);
|
||||||
|
}
|
||||||
| expr
|
| expr
|
||||||
|
|
||||||
expr : mlhs '=' mrhs
|
expr : mlhs '=' mrhs
|
||||||
@ -1009,17 +1013,17 @@ args : arg
|
|||||||
$$ = list_append($1, $3);
|
$$ = list_append($1, $3);
|
||||||
}
|
}
|
||||||
|
|
||||||
mrhs : args
|
mrhs : arg
|
||||||
{
|
{
|
||||||
if ($1 &&
|
value_expr($1);
|
||||||
nd_type($1) == NODE_ARRAY &&
|
$$ = $1;
|
||||||
$1->nd_next == 0)
|
}
|
||||||
{
|
| mrhs_basic
|
||||||
$$ = $1->nd_head;
|
|
||||||
}
|
mrhs_basic : args ',' arg
|
||||||
else {
|
{
|
||||||
$$ = $1;
|
value_expr($1);
|
||||||
}
|
$$ = list_append($1, $3);
|
||||||
}
|
}
|
||||||
| args ',' tSTAR arg
|
| args ',' tSTAR arg
|
||||||
{
|
{
|
||||||
@ -1211,7 +1215,7 @@ primary : literal
|
|||||||
compstmt
|
compstmt
|
||||||
kEND
|
kEND
|
||||||
{
|
{
|
||||||
value_expr($2);
|
value_expr($5);
|
||||||
$$ = NEW_FOR($2, $5, $8);
|
$$ = NEW_FOR($2, $5, $8);
|
||||||
fixpos($$, $2);
|
fixpos($$, $2);
|
||||||
}
|
}
|
||||||
@ -1357,11 +1361,11 @@ block_var : lhs
|
|||||||
opt_block_var : none
|
opt_block_var : none
|
||||||
| '|' /* none */ '|'
|
| '|' /* none */ '|'
|
||||||
{
|
{
|
||||||
$$ = 0;
|
$$ = (NODE*)1;
|
||||||
}
|
}
|
||||||
| tOROP
|
| tOROP
|
||||||
{
|
{
|
||||||
$$ = 0;
|
$$ = (NODE*)1;
|
||||||
}
|
}
|
||||||
| '|' block_var '|'
|
| '|' block_var '|'
|
||||||
{
|
{
|
||||||
@ -1390,7 +1394,7 @@ brace_block : '{'
|
|||||||
compstmt '}'
|
compstmt '}'
|
||||||
{
|
{
|
||||||
$$ = NEW_ITER($3, 0, $4);
|
$$ = NEW_ITER($3, 0, $4);
|
||||||
fixpos($$, $3?$3:$4);
|
fixpos($$, $4);
|
||||||
dyna_pop($<vars>2);
|
dyna_pop($<vars>2);
|
||||||
}
|
}
|
||||||
| kDO2
|
| kDO2
|
||||||
@ -1402,7 +1406,7 @@ brace_block : '{'
|
|||||||
kEND
|
kEND
|
||||||
{
|
{
|
||||||
$$ = NEW_ITER($3, 0, $4);
|
$$ = NEW_ITER($3, 0, $4);
|
||||||
fixpos($$, $3?$3:$4);
|
fixpos($$, $4);
|
||||||
dyna_pop($<vars>2);
|
dyna_pop($<vars>2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
86
string.c
86
string.c
@ -1468,90 +1468,65 @@ VALUE
|
|||||||
rb_str_inspect(str)
|
rb_str_inspect(str)
|
||||||
VALUE str;
|
VALUE str;
|
||||||
{
|
{
|
||||||
#define STRMAX 80
|
long len;
|
||||||
char buf[STRMAX];
|
|
||||||
char *p, *pend;
|
char *p, *pend;
|
||||||
char *b;
|
char *q, *qend;
|
||||||
VALUE inspect;
|
VALUE result = rb_str_new2("\"");
|
||||||
|
char s[5];
|
||||||
|
|
||||||
p = RSTRING(str)->ptr; pend = p + RSTRING(str)->len;
|
p = RSTRING(str)->ptr; pend = p + RSTRING(str)->len;
|
||||||
b = buf;
|
|
||||||
*b++ = '"';
|
|
||||||
|
|
||||||
#define CHECK(n) {\
|
|
||||||
if (b - buf + n > STRMAX - 4) {\
|
|
||||||
strcpy(b, "...");\
|
|
||||||
b += 3;\
|
|
||||||
break;\
|
|
||||||
}\
|
|
||||||
}
|
|
||||||
|
|
||||||
while (p < pend) {
|
while (p < pend) {
|
||||||
char c = *p++;
|
char c = *p++;
|
||||||
if (ismbchar(c) && p < pend) {
|
if (ismbchar(c) && p < pend) {
|
||||||
int len = mbclen(c);
|
int len = mbclen(c);
|
||||||
|
rb_str_cat(result, p, len);
|
||||||
CHECK(len);
|
p += len;
|
||||||
*b++ = c;
|
|
||||||
while (--len) {
|
|
||||||
*b++ = *p++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (c == '"'|| c == '\\') {
|
else if (c == '"'|| c == '\\') {
|
||||||
CHECK(2);
|
s[0] = '\\'; s[1] = c;
|
||||||
*b++ = '\\';
|
rb_str_cat(result, s, 2);
|
||||||
*b++ = c;
|
|
||||||
}
|
}
|
||||||
else if (ISPRINT(c)) {
|
else if (ISPRINT(c)) {
|
||||||
CHECK(1);
|
s[0] = c;
|
||||||
*b++ = c;
|
rb_str_cat(result, s, 1);
|
||||||
}
|
}
|
||||||
else if (c == '\n') {
|
else if (c == '\n') {
|
||||||
CHECK(2);
|
s[0] = '\\'; s[1] = 'n';
|
||||||
*b++ = '\\';
|
rb_str_cat(result, s, 2);
|
||||||
*b++ = 'n';
|
|
||||||
}
|
}
|
||||||
else if (c == '\r') {
|
else if (c == '\r') {
|
||||||
CHECK(2);
|
s[0] = '\\'; s[1] = 'r';
|
||||||
*b++ = '\\';
|
rb_str_cat(result, s, 2);
|
||||||
*b++ = 'r';
|
|
||||||
}
|
}
|
||||||
else if (c == '\t') {
|
else if (c == '\t') {
|
||||||
CHECK(2);
|
s[0] = '\\'; s[1] = 't';
|
||||||
*b++ = '\\';
|
rb_str_cat(result, s, 2);
|
||||||
*b++ = 't';
|
|
||||||
}
|
}
|
||||||
else if (c == '\f') {
|
else if (c == '\f') {
|
||||||
CHECK(2);
|
s[0] = '\\'; s[1] = 'f';
|
||||||
*b++ = '\\';
|
rb_str_cat(result, s, 2);
|
||||||
*b++ = 'f';
|
|
||||||
}
|
}
|
||||||
else if (c == '\013') {
|
else if (c == '\013') {
|
||||||
CHECK(2);
|
s[0] = '\\'; s[1] = 'v';
|
||||||
*b++ = '\\';
|
rb_str_cat(result, s, 2);
|
||||||
*b++ = 'v';
|
|
||||||
}
|
}
|
||||||
else if (c == '\007') {
|
else if (c == '\007') {
|
||||||
CHECK(2);
|
s[0] = '\\'; s[1] = 'a';
|
||||||
*b++ = '\\';
|
rb_str_cat(result, s, 2);
|
||||||
*b++ = 'a';
|
|
||||||
}
|
}
|
||||||
else if (c == 033) {
|
else if (c == 033) {
|
||||||
CHECK(2);
|
s[0] = '\\'; s[1] = 'e';
|
||||||
*b++ = '\\';
|
rb_str_cat(result, s, 2);
|
||||||
*b++ = 'e';
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CHECK(4);
|
sprintf(s, "\\%03o", c & 0377);
|
||||||
*b++ = '\\';
|
rb_str_cat2(result, s);
|
||||||
sprintf(b, "%03o", c & 0377);
|
|
||||||
b += 3;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*b++ = '"';
|
rb_str_cat2(result, "\"");
|
||||||
inspect = rb_str_new(buf, b - buf);
|
|
||||||
OBJ_INFECT(inspect, str);
|
OBJ_INFECT(result, str);
|
||||||
return inspect;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
@ -1641,6 +1616,7 @@ rb_str_dump(str)
|
|||||||
}
|
}
|
||||||
*q++ = '"';
|
*q++ = '"';
|
||||||
|
|
||||||
|
OBJ_INFECT(result, str);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
util.c
15
util.c
@ -509,21 +509,6 @@ fixpath(const char *in, char *out)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TEST
|
|
||||||
|
|
||||||
int main (int argc, char *argv[])
|
|
||||||
{
|
|
||||||
char fixed[FILENAME_MAX];
|
|
||||||
if (argc > 1)
|
|
||||||
{
|
|
||||||
_fixpath (argv[1], fixed);
|
|
||||||
printf ("You mean %s?\n", fixed);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* mm.c */
|
/* mm.c */
|
||||||
|
@ -870,8 +870,6 @@ rb_ivar_get(obj, id)
|
|||||||
{
|
{
|
||||||
VALUE val;
|
VALUE val;
|
||||||
|
|
||||||
if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4)
|
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't access instance variable");
|
|
||||||
switch (TYPE(obj)) {
|
switch (TYPE(obj)) {
|
||||||
case T_OBJECT:
|
case T_OBJECT:
|
||||||
case T_CLASS:
|
case T_CLASS:
|
||||||
@ -951,8 +949,6 @@ rb_obj_instance_variables(obj)
|
|||||||
{
|
{
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
|
|
||||||
if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4)
|
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't get metainfo");
|
|
||||||
ary = rb_ary_new();
|
ary = rb_ary_new();
|
||||||
switch (TYPE(obj)) {
|
switch (TYPE(obj)) {
|
||||||
case T_OBJECT:
|
case T_OBJECT:
|
||||||
@ -1152,8 +1148,6 @@ VALUE
|
|||||||
rb_mod_const_at(mod, ary)
|
rb_mod_const_at(mod, ary)
|
||||||
VALUE mod, ary;
|
VALUE mod, ary;
|
||||||
{
|
{
|
||||||
if (!OBJ_TAINTED(mod) && rb_safe_level() >= 4)
|
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't get metainfo");
|
|
||||||
if (RCLASS(mod)->iv_tbl) {
|
if (RCLASS(mod)->iv_tbl) {
|
||||||
st_foreach(RCLASS(mod)->iv_tbl, sv_i, ary);
|
st_foreach(RCLASS(mod)->iv_tbl, sv_i, ary);
|
||||||
}
|
}
|
||||||
@ -1477,9 +1471,6 @@ rb_mod_class_variables(obj)
|
|||||||
{
|
{
|
||||||
VALUE ary = rb_ary_new();
|
VALUE ary = rb_ary_new();
|
||||||
|
|
||||||
if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4)
|
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't get metainfo");
|
|
||||||
|
|
||||||
if (FL_TEST(obj, FL_SINGLETON)) {
|
if (FL_TEST(obj, FL_SINGLETON)) {
|
||||||
obj = rb_cvar_singleton(rb_iv_get(obj, "__attached__"));
|
obj = rb_cvar_singleton(rb_iv_get(obj, "__attached__"));
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define RUBY_VERSION "1.6.2"
|
#define RUBY_VERSION "1.6.2"
|
||||||
#define RUBY_RELEASE_DATE "2000-11-27"
|
#define RUBY_RELEASE_DATE "2000-12-05"
|
||||||
#define RUBY_VERSION_CODE 162
|
#define RUBY_VERSION_CODE 162
|
||||||
#define RUBY_RELEASE_CODE 20001127
|
#define RUBY_RELEASE_CODE 20001205
|
||||||
|
Loading…
x
Reference in New Issue
Block a user