summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-25 08:26:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-25 08:26:08 +0000
commit0cd7c01c6a4eaea12990fbcbd4d5b7c1a517683b (patch)
treed5719c034146d507ae7e539753e1a67f2f7235fa
parentd4db9e9c6091e5763a869792f63006fb0498a1b8 (diff)
* eval.c (rb_yield_0): call avalue_to_mrhs() to assign block
parameter |a|. [ruby-dev:19897] * ruby.c (ruby_set_argv): freeze argument strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--eval.c2
-rw-r--r--ruby.c5
3 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8db9960..ae78aea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Mar 25 12:24:15 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_yield_0): call avalue_to_mrhs() to assign block
+ parameter |a|. [ruby-dev:19897]
+
+ * ruby.c (ruby_set_argv): freeze argument strings.
+
Tue Mar 25 12:01:54 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_initialize): should check rb_secure(4).
diff --git a/eval.c b/eval.c
index ec3327f..e59ad61 100644
--- a/eval.c
+++ b/eval.c
@@ -3982,7 +3982,7 @@ rb_yield_0(val, self, klass, pcall, avalue)
massign(self, block->var, val, pcall);
}
else {
- if (avalue) val = avalue_to_svalue(val);
+ if (avalue) val = avalue_to_mrhs(val);
if (val == Qundef) val = Qnil;
assign(self, block->var, val, pcall);
}
diff --git a/ruby.c b/ruby.c
index 40d9dbd..4f25fc4 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1055,7 +1055,10 @@ ruby_set_argv(argc, argv)
#endif
rb_ary_clear(rb_argv);
for (i=0; i < argc; i++) {
- rb_ary_push(rb_argv, rb_tainted_str_new2(argv[i]));
+ VALUE arg = rb_tainted_str_new2(argv[i]);
+
+ OBJ_FREEZE(arg);
+ rb_ary_push(rb_argv, arg);
}
}