summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog25
-rw-r--r--config.sub4
-rw-r--r--eval.c2
-rw-r--r--parse.y22
-rw-r--r--re.c18
5 files changed, 53 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index eee2aae77c..2a5c53c48d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
diff --git a/config.sub b/config.sub
index 3c591de61b..27dae9e8f5 100644
--- a/config.sub
+++ b/config.sub
@@ -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
diff --git a/eval.c b/eval.c
index b5db5eac17..0610455f1c 100644
--- a/eval.c
+++ b/eval.c
@@ -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 {
diff --git a/parse.y b/parse.y
index 7b47c7f6ed..d0cdbffb14 100644
--- a/parse.y
+++ b/parse.y
@@ -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
{
diff --git a/re.c b/re.c
index a778efca6c..d4e2bade70 100644
--- a/re.c
+++ b/re.c
@@ -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;