1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_load): should check if tainted even when wrap is

specified.

* regex.c (re_compile_pattern): too much optimization for the
  cases like /(.|a)b/.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-06-06 07:40:31 +00:00
parent 7c9c33e9ad
commit f0ccffd530
4 changed files with 12 additions and 23 deletions

View file

@ -1,6 +1,14 @@
Wed Jun 6 16:11:06 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_load): should check if tainted even when wrap is
specified.
Wed Jun 6 14:34:27 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (aref_args): "*arg" should always be expanded by REXPAND.
* parse.y (mrhs_basic): "*arg" should always be expanded by REXPAND.
* regex.c (re_compile_pattern): too much optimization for the
cases like /(.|a)b/.
Tue Jun 5 23:58:43 2001 Yukihiro Matsumoto <matz@ruby-lang.org>

7
eval.c
View file

@ -5167,12 +5167,7 @@ rb_load(fname, wrap)
NODE *saved_cref = ruby_cref;
TMP_PROTECT;
if (wrap) {
StringValue(fname);
}
else {
SafeStringValue(fname);
}
SafeStringValue(fname);
file = rb_find_file(RSTRING(fname)->ptr);
if (!file) {
rb_raise(rb_eLoadError, "No such file to load -- %s", RSTRING(fname)->ptr);

View file

@ -1147,7 +1147,7 @@ mrhs_basic : args ',' arg
| tSTAR arg
{
value_expr($2);
$$ = NEW_RESTARGS($2);
$$ = NEW_REXPAND($2);
}
primary : literal

16
regex.c
View file

@ -2381,21 +2381,7 @@ re_compile_pattern(pattern, size, bufp)
laststart++;
EXTRACT_NUMBER_AND_INCR(mcnt, laststart);
if (mcnt == 4 && *laststart == anychar) {
switch ((enum regexpcode)laststart[1]) {
case jump_n:
case finalize_jump:
case maybe_finalize_jump:
case jump:
case jump_past_alt:
case dummy_failure_jump:
bufp->options |= RE_OPTIMIZE_ANCHOR;
break;
default:
break;
}
}
else if (*laststart == charset || *laststart == charset_not) {
if (*laststart == charset || *laststart == charset_not) {
p0 = laststart;
mcnt = *++p0;
p0 += mcnt+1;