1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-07-01 06:47:47 +00:00
parent 11fef7fd63
commit c7d499225b
5 changed files with 53 additions and 18 deletions

View file

@ -1,3 +1,24 @@
Sat Jul 1 15:22:35 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (rb_eval): the value from RTEST() is not valid Ruby
objct. result shoule be either true or false.
Sat Jul 1 09:30:06 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
* re.c (rb_reg_initialize): was freeing invalid pointer.
Sat Jul 1 03:25:56 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* parse.y (call_args): command_call can be the last argument of
call_args. It had to be the only argument.
* re.c (rb_reg_s_quote): should not dump core even for unsane mbc
string.
Fri Jun 30 01:36:20 2000 Aleksi Niemela <aleksi.niemela@cinnober.com>
* parse.y (f_norm_arg): better, nicer error message.
Thu Jun 29 07:45:33 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* ext/socket/socket.c (udp_send): destination may be packed
@ -19,6 +40,10 @@ Wed Jun 28 17:26:06 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* ruby.c (proc_options): -e, - did not exec -r.
Wed Jun 28 14:52:28 2000 Koga Youichirou <y-koga@mms.mt.nec.co.jp>
* config.sub: NetBSD/hpcmips support.
Wed Jun 28 10:11:06 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* gc.c: gc trigger threshold changed; GC_NEWOBJ_LIMIT removed,

4
config.sub vendored
View file

@ -525,6 +525,10 @@ case $basic_machine in
basic_machine=i386-unknown
os=-netbsd
;;
hpcmips*-*)
basic_machine=hpcmips-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-corel
os=-linux

2
eval.c
View file

@ -2311,7 +2311,7 @@ rb_eval(self, n)
rb_bug("unexpected local variable");
}
if (!RTEST(ruby_scope->local_vars[node->nd_cnt])) {
result = RTEST(rb_eval(self, node->nd_beg));
result = RTEST(rb_eval(self, node->nd_beg)) ? Qtrue : Qfalse;
ruby_scope->local_vars[node->nd_cnt] = result;
}
else {

22
parse.y
View file

@ -861,14 +861,14 @@ opt_call_args : none
| call_args opt_nl
call_args : command_call
{
value_expr($1);
$$ = NEW_LIST($1);
}
| args ','
{
$$ = $1;
}
| args ',' command_call
{
$$ = list_append($1, $3);
}
| args opt_block_arg
{
$$ = arg_blk_pass($1, $2);
@ -1592,7 +1592,19 @@ f_args : f_arg ',' f_optarg ',' f_rest_arg opt_f_block_arg
f_norm_arg : tCONSTANT
{
yyerror("formal argument must not be constant");
yyerror("formal argument cannot be a constant");
}
| tIVAR
{
yyerror("formal argument cannot be an instance variable");
}
| tGVAR
{
yyerror("formal argument cannot be a global variable");
}
| tCVAR
{
yyerror("formal argument cannot be a class variable");
}
| tIDENTIFIER
{

18
re.c
View file

@ -88,12 +88,6 @@ rb_memcmp(p1, p2, len)
return 0;
}
int
rb_str_cicmp(str1, str2)
VALUE str1, str2;
{
}
#define REG_CASESTATE FL_USER0
#define KCODE_NONE 0
#define KCODE_EUC FL_USER1
@ -830,7 +824,7 @@ rb_reg_initialize(obj, s, len, options)
struct RRegexp *re = RREGEXP(obj);
if (re->ptr) re_free_pattern(re->ptr);
if (re->str) free(re->ptr);
if (re->str) free(re->str);
re->ptr = 0;
re->str = 0;
@ -879,7 +873,7 @@ rb_reg_new(s, len, options)
NEWOBJ(re, struct RRegexp);
OBJSETUP(re, rb_cRegexp, T_REGEXP);
re->ptr = 0; re->len = 0;
re->ptr = 0; re->len = 0; re->str = 0;
rb_reg_initialize(re, s, len, options);
return (VALUE)re;
}
@ -1036,7 +1030,7 @@ rb_reg_s_new(argc, argv, klass)
{
NEWOBJ(re, struct RRegexp);
OBJSETUP(re, klass, T_REGEXP);
re->ptr = 0; re->len = 0;
re->ptr = 0; re->len = 0; re->str = 0;
rb_obj_call_init((VALUE)re, argc, argv);
return (VALUE)re;
}
@ -1063,11 +1057,11 @@ rb_reg_s_quote(argc, argv)
tmp = ALLOCA_N(char, len*2);
t = tmp;
for (; s != send; s++) {
for (; s < send; s++) {
if (ismbchar(*s)) {
size_t n = mbclen(*s);
while (n--)
while (n-- && s < send)
*t++ = *s++;
s--;
continue;
@ -1146,7 +1140,7 @@ rb_reg_clone(re)
NEWOBJ(clone, struct RRegexp);
CLONESETUP(clone, re);
rb_reg_check(re);
clone->ptr = 0; clone->len = 0;
clone->ptr = 0; clone->len = 0; clone->str = 0;
rb_reg_initialize(clone, RREGEXP(re)->str, RREGEXP(re)->len,
rb_reg_options(re));
return (VALUE)re;