mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
161e3313d2
commit
2f0faf671d
17 changed files with 50 additions and 40 deletions
|
@ -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>
|
Fri Jan 26 01:42:40 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y: clarify do ambiguity, bit more complex but natural
|
* parse.y: clarify do ambiguity, bit more complex but natural
|
||||||
|
|
2
enum.c
2
enum.c
|
@ -6,7 +6,7 @@
|
||||||
$Date$
|
$Date$
|
||||||
created at: Fri Oct 1 15:15:19 JST 1993
|
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$
|
$Date$
|
||||||
created at: Mon Aug 9 16:11:34 JST 1993
|
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$
|
$Date$
|
||||||
created at: Thu Jun 10 14:22:17 JST 1993
|
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 Network Applied Communication Laboratory, Inc.
|
||||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||||
|
|
||||||
|
@ -5205,7 +5205,7 @@ rb_feature_p(feature, wait)
|
||||||
|
|
||||||
while (st_lookup(loading_tbl, f, &th)) {
|
while (st_lookup(loading_tbl, f, &th)) {
|
||||||
if (th == curr_thread) {
|
if (th == curr_thread) {
|
||||||
rb_raise(rb_eLoadError, "infinite load loop -- %s", f);
|
return Qtrue;
|
||||||
}
|
}
|
||||||
CHECK_INTS;
|
CHECK_INTS;
|
||||||
rb_thread_schedule();
|
rb_thread_schedule();
|
||||||
|
|
2
file.c
2
file.c
|
@ -6,7 +6,7 @@
|
||||||
$Date$
|
$Date$
|
||||||
created at: Mon Nov 15 12:24:34 JST 1993
|
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 Network Applied Communication Laboratory, Inc.
|
||||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||||
|
|
||||||
|
|
24
gc.c
24
gc.c
|
@ -6,7 +6,7 @@
|
||||||
$Date$
|
$Date$
|
||||||
created at: Tue Oct 5 09:44:46 JST 1993
|
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 Network Applied Communication Laboratory, Inc.
|
||||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||||
|
|
||||||
|
@ -149,8 +149,8 @@ static int during_gc;
|
||||||
static int need_call_final = 0;
|
static int need_call_final = 0;
|
||||||
static st_table *finalizer_table = 0;
|
static st_table *finalizer_table = 0;
|
||||||
|
|
||||||
static VALUE
|
VALUE
|
||||||
gc_enable()
|
rb_gc_enable()
|
||||||
{
|
{
|
||||||
int old = dont_gc;
|
int old = dont_gc;
|
||||||
|
|
||||||
|
@ -158,8 +158,8 @@ gc_enable()
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
VALUE
|
||||||
gc_disable()
|
rb_gc_disable()
|
||||||
{
|
{
|
||||||
int old = dont_gc;
|
int old = dont_gc;
|
||||||
|
|
||||||
|
@ -996,8 +996,8 @@ rb_gc()
|
||||||
gc_sweep();
|
gc_sweep();
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
VALUE
|
||||||
gc_start()
|
rb_gc_start()
|
||||||
{
|
{
|
||||||
rb_gc();
|
rb_gc();
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
@ -1299,14 +1299,14 @@ Init_GC()
|
||||||
VALUE rb_mObSpace;
|
VALUE rb_mObSpace;
|
||||||
|
|
||||||
rb_mGC = rb_define_module("GC");
|
rb_mGC = rb_define_module("GC");
|
||||||
rb_define_singleton_method(rb_mGC, "start", gc_start, 0);
|
rb_define_singleton_method(rb_mGC, "start", rb_gc_start, 0);
|
||||||
rb_define_singleton_method(rb_mGC, "enable", gc_enable, 0);
|
rb_define_singleton_method(rb_mGC, "enable", rb_gc_enable, 0);
|
||||||
rb_define_singleton_method(rb_mGC, "disable", gc_disable, 0);
|
rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0);
|
||||||
rb_define_method(rb_mGC, "garbage_collect", gc_start, 0);
|
rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0);
|
||||||
|
|
||||||
rb_mObSpace = rb_define_module("ObjectSpace");
|
rb_mObSpace = rb_define_module("ObjectSpace");
|
||||||
rb_define_module_function(rb_mObSpace, "each_object", os_each_obj, -1);
|
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, "add_finalizer", add_final, 1);
|
||||||
rb_define_module_function(rb_mObSpace, "remove_finalizer", rm_final, 1);
|
rb_define_module_function(rb_mObSpace, "remove_finalizer", rm_final, 1);
|
||||||
rb_define_module_function(rb_mObSpace, "finalizers", finals, 0);
|
rb_define_module_function(rb_mObSpace, "finalizers", finals, 0);
|
||||||
|
|
2
io.c
2
io.c
|
@ -6,7 +6,7 @@
|
||||||
$Date$
|
$Date$
|
||||||
created at: Fri Oct 15 18:08:59 JST 1993
|
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 Network Applied Communication Laboratory, Inc.
|
||||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||||
|
|
||||||
|
|
2
object.c
2
object.c
|
@ -6,7 +6,7 @@
|
||||||
$Date$
|
$Date$
|
||||||
created at: Thu Jul 15 12:01:24 JST 1993
|
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 Network Applied Communication Laboratory, Inc.
|
||||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||||
|
|
||||||
|
|
2
pack.c
2
pack.c
|
@ -6,7 +6,7 @@
|
||||||
$Date$
|
$Date$
|
||||||
created at: Thu Feb 10 15:17:05 JST 1994
|
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$
|
$Date$
|
||||||
created at: Fri May 28 18:02:42 JST 1993
|
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. */
|
EXPR_CLASS, /* immediate after `class', no here document. */
|
||||||
} lex_state;
|
} 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 int cond_nest = 0;
|
||||||
static unsigned long cond_stack = 0;
|
static stack_type cond_stack = 0;
|
||||||
#define COND_PUSH do {\
|
#define COND_PUSH do {\
|
||||||
cond_nest++;\
|
cond_nest++;\
|
||||||
cond_stack = (cond_stack<<1)|1;\
|
cond_stack = (cond_stack<<1)|1;\
|
||||||
|
@ -68,17 +76,14 @@ static unsigned long cond_stack = 0;
|
||||||
} while (0)
|
} while (0)
|
||||||
#define COND_P() (cond_nest > 0 && (cond_stack&1))
|
#define COND_P() (cond_nest > 0 && (cond_stack&1))
|
||||||
|
|
||||||
static int cmdarg_nest = 0;
|
static stack_type cmdarg_stack = 0;
|
||||||
static unsigned long cmdarg_stack = 0;
|
|
||||||
#define CMDARG_PUSH do {\
|
#define CMDARG_PUSH do {\
|
||||||
cmdarg_nest++;\
|
|
||||||
cmdarg_stack = (cmdarg_stack<<1)|1;\
|
cmdarg_stack = (cmdarg_stack<<1)|1;\
|
||||||
} while(0)
|
} while(0)
|
||||||
#define CMDARG_POP do {\
|
#define CMDARG_POP do {\
|
||||||
cmdarg_nest--;\
|
|
||||||
cmdarg_stack >>= 1;\
|
cmdarg_stack >>= 1;\
|
||||||
} while (0)
|
} 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 class_nest = 0;
|
||||||
static int in_single = 0;
|
static int in_single = 0;
|
||||||
|
|
|
@ -952,7 +952,7 @@ proc_setuid(obj, id)
|
||||||
int uid;
|
int uid;
|
||||||
|
|
||||||
uid = NUM2INT(id);
|
uid = NUM2INT(id);
|
||||||
#if defined HAVE_SETRESUID
|
#if defined(HAVE_SETRESUID) && !defined(__CHECKER__)
|
||||||
setresuid(uid, -1, -1);
|
setresuid(uid, -1, -1);
|
||||||
#elif defined HAVE_SETREUID
|
#elif defined HAVE_SETREUID
|
||||||
setreuid(uid, -1);
|
setreuid(uid, -1);
|
||||||
|
@ -984,7 +984,7 @@ proc_setgid(obj, id)
|
||||||
int gid;
|
int gid;
|
||||||
|
|
||||||
gid = NUM2INT(id);
|
gid = NUM2INT(id);
|
||||||
#if defined HAVE_SETRESGID
|
#if defined(HAVE_SETRESGID) && !defined(__CHECKER__)
|
||||||
setresgid(gid, -1, -1);
|
setresgid(gid, -1, -1);
|
||||||
#elif defined HAVE_SETREGID
|
#elif defined HAVE_SETREGID
|
||||||
setregid(gid, -1);
|
setregid(gid, -1);
|
||||||
|
@ -1013,7 +1013,7 @@ static VALUE
|
||||||
proc_seteuid(obj, euid)
|
proc_seteuid(obj, euid)
|
||||||
VALUE 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);
|
if (setresuid(-1, NUM2INT(euid), -1) < 0) rb_sys_fail(0);
|
||||||
#elif defined HAVE_SETREUID
|
#elif defined HAVE_SETREUID
|
||||||
if (setreuid(-1, NUM2INT(euid)) < 0) rb_sys_fail(0);
|
if (setreuid(-1, NUM2INT(euid)) < 0) rb_sys_fail(0);
|
||||||
|
@ -1042,7 +1042,7 @@ proc_setegid(obj, egid)
|
||||||
VALUE obj, egid;
|
VALUE obj, egid;
|
||||||
{
|
{
|
||||||
rb_secure(2);
|
rb_secure(2);
|
||||||
#if defined HAVE_SETRESGID
|
#if defined(HAVE_SETRESGID) && !defined(__CHECKER__)
|
||||||
if (setresgid(-1, NUM2INT(egid), -1) < 0) rb_sys_fail(0);
|
if (setresgid(-1, NUM2INT(egid), -1) < 0) rb_sys_fail(0);
|
||||||
#elif defined HAVE_SETREGID
|
#elif defined HAVE_SETREGID
|
||||||
if (setregid(-1, NUM2INT(egid)) < 0) rb_sys_fail(0);
|
if (setregid(-1, NUM2INT(egid)) < 0) rb_sys_fail(0);
|
||||||
|
|
2
re.c
2
re.c
|
@ -5,7 +5,7 @@
|
||||||
$Author$
|
$Author$
|
||||||
created at: Mon Aug 9 18:24:49 JST 1993
|
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$
|
$Date$
|
||||||
created at: Tue Aug 10 12:47:31 JST 1993
|
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 Network Applied Communication Laboratory, Inc.
|
||||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||||
|
|
||||||
|
|
2
ruby.h
2
ruby.h
|
@ -5,7 +5,7 @@
|
||||||
$Author$
|
$Author$
|
||||||
created at: Thu Jun 10 14:26:32 JST 1993
|
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 Network Applied Communication Laboratory, Inc.
|
||||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
$Date$
|
$Date$
|
||||||
created at: Fri Oct 15 10:39:26 JST 1993
|
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 Network Applied Communication Laboratory, Inc.
|
||||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||||
|
|
||||||
|
|
6
string.c
6
string.c
|
@ -6,7 +6,7 @@
|
||||||
$Date$
|
$Date$
|
||||||
created at: Mon Aug 9 17:12:58 JST 1993
|
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 Network Applied Communication Laboratory, Inc.
|
||||||
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
||||||
|
|
||||||
|
@ -377,7 +377,6 @@ str_independent(str)
|
||||||
rb_raise(rb_eSecurityError, "Insecure: can't modify string");
|
rb_raise(rb_eSecurityError, "Insecure: can't modify string");
|
||||||
if (!RSTRING(str)->orig || FL_TEST(str, STR_NO_ORIG)) return 1;
|
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");
|
if (TYPE(RSTRING(str)->orig) != T_STRING) rb_bug("non string str->orig");
|
||||||
RSTRING(str)->orig = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,6 +393,7 @@ rb_str_modify(str)
|
||||||
}
|
}
|
||||||
ptr[RSTRING(str)->len] = 0;
|
ptr[RSTRING(str)->len] = 0;
|
||||||
RSTRING(str)->ptr = ptr;
|
RSTRING(str)->ptr = ptr;
|
||||||
|
RSTRING(str)->orig = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
|
@ -1294,11 +1294,11 @@ str_gsub(argc, argv, str, bang)
|
||||||
OBJSETUP(dup, rb_cString, T_STRING);
|
OBJSETUP(dup, rb_cString, T_STRING);
|
||||||
OBJ_INFECT(dup, str);
|
OBJ_INFECT(dup, str);
|
||||||
str = (VALUE)dup;
|
str = (VALUE)dup;
|
||||||
dup->orig = 0;
|
|
||||||
}
|
}
|
||||||
RSTRING(str)->ptr = buf;
|
RSTRING(str)->ptr = buf;
|
||||||
RSTRING(str)->len = len = bp - buf;
|
RSTRING(str)->len = len = bp - buf;
|
||||||
RSTRING(str)->ptr[len] = '\0';
|
RSTRING(str)->ptr[len] = '\0';
|
||||||
|
RSTRING(str)->orig = 0;
|
||||||
|
|
||||||
if (tainted) OBJ_TAINT(str);
|
if (tainted) OBJ_TAINT(str);
|
||||||
return str;
|
return str;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#define RUBY_VERSION "1.7.0"
|
#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_VERSION_CODE 170
|
||||||
#define RUBY_RELEASE_CODE 20010123
|
#define RUBY_RELEASE_CODE 20010129
|
||||||
|
|
Loading…
Add table
Reference in a new issue