summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--eval.c13
-rw-r--r--version.h8
3 files changed, 19 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index d93647f..190c1fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Jun 16 15:43:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * proc.c (proc_dup): should copy safe_level from src proc
+ properly. a patch from Keita Yamaguchi
+ <keita.yamaguchi at gmail.com>
+
Sun Jun 15 23:31:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/zlib/extconf.rb: search zlib1, and regard mswin32 later than VC6
diff --git a/eval.c b/eval.c
index b83c6e2..951676c 100644
--- a/eval.c
+++ b/eval.c
@@ -8345,16 +8345,25 @@ proc_clone(self)
* MISSING: documentation
*/
+#define PROC_TSHIFT (FL_USHIFT+1)
+#define PROC_TMASK (FL_USER1|FL_USER2|FL_USER3)
+#define PROC_TMAX (PROC_TMASK >> PROC_TSHIFT)
+
+static int proc_get_safe_level(VALUE);
+
static VALUE
proc_dup(self)
VALUE self;
{
struct BLOCK *orig, *data;
VALUE bind;
+ int safe = proc_get_safe_level(self);
Data_Get_Struct(self, struct BLOCK, orig);
bind = Data_Make_Struct(rb_obj_class(self),struct BLOCK,blk_mark,blk_free,data);
blk_dup(data, orig);
+ if (safe > PROC_TMAX) safe = PROC_TMAX;
+ FL_SET(bind, (safe << PROC_TSHIFT) & PROC_TMASK);
return bind;
}
@@ -8416,10 +8425,6 @@ rb_f_binding(self)
return bind;
}
-#define PROC_TSHIFT (FL_USHIFT+1)
-#define PROC_TMASK (FL_USER1|FL_USER2|FL_USER3)
-#define PROC_TMAX (PROC_TMASK >> PROC_TSHIFT)
-
#define SAFE_LEVEL_MAX PROC_TMASK
static void
diff --git a/version.h b/version.h
index 1381fbd..f116852 100644
--- a/version.h
+++ b/version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.6"
-#define RUBY_RELEASE_DATE "2008-06-15"
+#define RUBY_RELEASE_DATE "2008-06-16"
#define RUBY_VERSION_CODE 186
-#define RUBY_RELEASE_CODE 20080615
-#define RUBY_PATCHLEVEL 221
+#define RUBY_RELEASE_CODE 20080616
+#define RUBY_PATCHLEVEL 222
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 6
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 15
+#define RUBY_RELEASE_DAY 16
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];