зеркало из https://github.com/github/ruby.git
* string.c (str_independent): should not clear str->orig here.
it's too early. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
161e3313d2
Коммит
2f0faf671d
|
@ -1,3 +1,8 @@
|
|||
Mon Jan 29 01:40:27 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* string.c (str_independent): should not clear str->orig here.
|
||||
it's too early.
|
||||
|
||||
Fri Jan 26 01:42:40 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* parse.y: clarify do ambiguity, bit more complex but natural
|
||||
|
|
2
enum.c
2
enum.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Fri Oct 1 15:15:19 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
|
2
error.c
2
error.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Mon Aug 9 16:11:34 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
|
4
eval.c
4
eval.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Thu Jun 10 14:22:17 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
|
@ -5205,7 +5205,7 @@ rb_feature_p(feature, wait)
|
|||
|
||||
while (st_lookup(loading_tbl, f, &th)) {
|
||||
if (th == curr_thread) {
|
||||
rb_raise(rb_eLoadError, "infinite load loop -- %s", f);
|
||||
return Qtrue;
|
||||
}
|
||||
CHECK_INTS;
|
||||
rb_thread_schedule();
|
||||
|
|
2
file.c
2
file.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Mon Nov 15 12:24:34 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
|
|
24
gc.c
24
gc.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Tue Oct 5 09:44:46 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
|
@ -149,8 +149,8 @@ static int during_gc;
|
|||
static int need_call_final = 0;
|
||||
static st_table *finalizer_table = 0;
|
||||
|
||||
static VALUE
|
||||
gc_enable()
|
||||
VALUE
|
||||
rb_gc_enable()
|
||||
{
|
||||
int old = dont_gc;
|
||||
|
||||
|
@ -158,8 +158,8 @@ gc_enable()
|
|||
return old;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
gc_disable()
|
||||
VALUE
|
||||
rb_gc_disable()
|
||||
{
|
||||
int old = dont_gc;
|
||||
|
||||
|
@ -996,8 +996,8 @@ rb_gc()
|
|||
gc_sweep();
|
||||
}
|
||||
|
||||
static VALUE
|
||||
gc_start()
|
||||
VALUE
|
||||
rb_gc_start()
|
||||
{
|
||||
rb_gc();
|
||||
return Qnil;
|
||||
|
@ -1299,14 +1299,14 @@ Init_GC()
|
|||
VALUE rb_mObSpace;
|
||||
|
||||
rb_mGC = rb_define_module("GC");
|
||||
rb_define_singleton_method(rb_mGC, "start", gc_start, 0);
|
||||
rb_define_singleton_method(rb_mGC, "enable", gc_enable, 0);
|
||||
rb_define_singleton_method(rb_mGC, "disable", gc_disable, 0);
|
||||
rb_define_method(rb_mGC, "garbage_collect", gc_start, 0);
|
||||
rb_define_singleton_method(rb_mGC, "start", rb_gc_start, 0);
|
||||
rb_define_singleton_method(rb_mGC, "enable", rb_gc_enable, 0);
|
||||
rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0);
|
||||
rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0);
|
||||
|
||||
rb_mObSpace = rb_define_module("ObjectSpace");
|
||||
rb_define_module_function(rb_mObSpace, "each_object", os_each_obj, -1);
|
||||
rb_define_module_function(rb_mObSpace, "garbage_collect", gc_start, 0);
|
||||
rb_define_module_function(rb_mObSpace, "garbage_collect", rb_gc_start, 0);
|
||||
rb_define_module_function(rb_mObSpace, "add_finalizer", add_final, 1);
|
||||
rb_define_module_function(rb_mObSpace, "remove_finalizer", rm_final, 1);
|
||||
rb_define_module_function(rb_mObSpace, "finalizers", finals, 0);
|
||||
|
|
2
io.c
2
io.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Fri Oct 15 18:08:59 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
|
|
2
object.c
2
object.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Thu Jul 15 12:01:24 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
|
|
2
pack.c
2
pack.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Thu Feb 10 15:17:05 JST 1994
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
|
19
parse.y
19
parse.y
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Fri May 28 18:02:42 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
@ -56,8 +56,16 @@ static enum lex_state {
|
|||
EXPR_CLASS, /* immediate after `class', no here document. */
|
||||
} lex_state;
|
||||
|
||||
#if SIZEOF_LONG_LONG > 0
|
||||
typedef unsigned long long stack_type;
|
||||
#elif SIZEOF___INT64 > 0
|
||||
typedef unsigned __int64 stack_type;
|
||||
#else
|
||||
typedef unsigned long stack_type;
|
||||
#endif
|
||||
|
||||
static int cond_nest = 0;
|
||||
static unsigned long cond_stack = 0;
|
||||
static stack_type cond_stack = 0;
|
||||
#define COND_PUSH do {\
|
||||
cond_nest++;\
|
||||
cond_stack = (cond_stack<<1)|1;\
|
||||
|
@ -68,17 +76,14 @@ static unsigned long cond_stack = 0;
|
|||
} while (0)
|
||||
#define COND_P() (cond_nest > 0 && (cond_stack&1))
|
||||
|
||||
static int cmdarg_nest = 0;
|
||||
static unsigned long cmdarg_stack = 0;
|
||||
static stack_type cmdarg_stack = 0;
|
||||
#define CMDARG_PUSH do {\
|
||||
cmdarg_nest++;\
|
||||
cmdarg_stack = (cmdarg_stack<<1)|1;\
|
||||
} while(0)
|
||||
#define CMDARG_POP do {\
|
||||
cmdarg_nest--;\
|
||||
cmdarg_stack >>= 1;\
|
||||
} while (0)
|
||||
#define CMDARG_P() (cmdarg_nest > 0 && (cmdarg_stack&1))
|
||||
#define CMDARG_P() (cmdarg_stack && (cmdarg_stack&1))
|
||||
|
||||
static int class_nest = 0;
|
||||
static int in_single = 0;
|
||||
|
|
|
@ -952,7 +952,7 @@ proc_setuid(obj, id)
|
|||
int uid;
|
||||
|
||||
uid = NUM2INT(id);
|
||||
#if defined HAVE_SETRESUID
|
||||
#if defined(HAVE_SETRESUID) && !defined(__CHECKER__)
|
||||
setresuid(uid, -1, -1);
|
||||
#elif defined HAVE_SETREUID
|
||||
setreuid(uid, -1);
|
||||
|
@ -984,7 +984,7 @@ proc_setgid(obj, id)
|
|||
int gid;
|
||||
|
||||
gid = NUM2INT(id);
|
||||
#if defined HAVE_SETRESGID
|
||||
#if defined(HAVE_SETRESGID) && !defined(__CHECKER__)
|
||||
setresgid(gid, -1, -1);
|
||||
#elif defined HAVE_SETREGID
|
||||
setregid(gid, -1);
|
||||
|
@ -1013,7 +1013,7 @@ static VALUE
|
|||
proc_seteuid(obj, euid)
|
||||
VALUE obj, euid;
|
||||
{
|
||||
#if defined HAVE_SETRESUID
|
||||
#if defined(HAVE_SETRESUID) && !defined(__CHECKER__)
|
||||
if (setresuid(-1, NUM2INT(euid), -1) < 0) rb_sys_fail(0);
|
||||
#elif defined HAVE_SETREUID
|
||||
if (setreuid(-1, NUM2INT(euid)) < 0) rb_sys_fail(0);
|
||||
|
@ -1042,7 +1042,7 @@ proc_setegid(obj, egid)
|
|||
VALUE obj, egid;
|
||||
{
|
||||
rb_secure(2);
|
||||
#if defined HAVE_SETRESGID
|
||||
#if defined(HAVE_SETRESGID) && !defined(__CHECKER__)
|
||||
if (setresgid(-1, NUM2INT(egid), -1) < 0) rb_sys_fail(0);
|
||||
#elif defined HAVE_SETREGID
|
||||
if (setregid(-1, NUM2INT(egid)) < 0) rb_sys_fail(0);
|
||||
|
|
2
re.c
2
re.c
|
@ -5,7 +5,7 @@
|
|||
$Author$
|
||||
created at: Mon Aug 9 18:24:49 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
|
2
ruby.c
2
ruby.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Tue Aug 10 12:47:31 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
|
|
2
ruby.h
2
ruby.h
|
@ -5,7 +5,7 @@
|
|||
$Author$
|
||||
created at: Thu Jun 10 14:26:32 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Fri Oct 15 10:39:26 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
|
|
6
string.c
6
string.c
|
@ -6,7 +6,7 @@
|
|||
$Date$
|
||||
created at: Mon Aug 9 17:12:58 JST 1993
|
||||
|
||||
Copyright (C) 1993-2000 Yukihiro Matsumoto
|
||||
Copyright (C) 1993-2001 Yukihiro Matsumoto
|
||||
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||
|
||||
|
@ -377,7 +377,6 @@ str_independent(str)
|
|||
rb_raise(rb_eSecurityError, "Insecure: can't modify string");
|
||||
if (!RSTRING(str)->orig || FL_TEST(str, STR_NO_ORIG)) return 1;
|
||||
if (TYPE(RSTRING(str)->orig) != T_STRING) rb_bug("non string str->orig");
|
||||
RSTRING(str)->orig = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -394,6 +393,7 @@ rb_str_modify(str)
|
|||
}
|
||||
ptr[RSTRING(str)->len] = 0;
|
||||
RSTRING(str)->ptr = ptr;
|
||||
RSTRING(str)->orig = 0;
|
||||
}
|
||||
|
||||
VALUE
|
||||
|
@ -1294,11 +1294,11 @@ str_gsub(argc, argv, str, bang)
|
|||
OBJSETUP(dup, rb_cString, T_STRING);
|
||||
OBJ_INFECT(dup, str);
|
||||
str = (VALUE)dup;
|
||||
dup->orig = 0;
|
||||
}
|
||||
RSTRING(str)->ptr = buf;
|
||||
RSTRING(str)->len = len = bp - buf;
|
||||
RSTRING(str)->ptr[len] = '\0';
|
||||
RSTRING(str)->orig = 0;
|
||||
|
||||
if (tainted) OBJ_TAINT(str);
|
||||
return str;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#define RUBY_VERSION "1.7.0"
|
||||
#define RUBY_RELEASE_DATE "2001-01-23"
|
||||
#define RUBY_RELEASE_DATE "2001-01-29"
|
||||
#define RUBY_VERSION_CODE 170
|
||||
#define RUBY_RELEASE_CODE 20010123
|
||||
#define RUBY_RELEASE_CODE 20010129
|
||||
|
|
Загрузка…
Ссылка в новой задаче